Check out our new Credits! Buy credits and contact our support to double your prize. Credits

Documentation

Reference for hosting projects, project files, runtimes, databases and deployment configuration on Cloudexa.

Getting started

The shortest path from code to a running Cloudexa project.

  1. Create a project Choose a name and, optionally, build, start and port settings.
  2. Add your files Upload or edit the source from the project's Storage tab.
  3. Deploy Cloudexa syncs the source, runs the build and starts the application.

Project files

Cloudexa stores each project's application files directly on the NAS.

Create a hosting project, open its Storage tab, then upload or edit the files that should be deployed.

Storage layout
/mnt/cloudexa-nas/projects/<project-id>/app
Source of truth

The NAS copy is the deployment source. A redeploy builds from the files currently stored there.

Deployments

A deployment starts from the files currently stored in the project directory.

Cloudexa applies tracked source changes to the project's persistent application directory, runs the build, then starts the application container.

Deployment flow
project files on NAS
  -> build image
  -> start container
  -> route hostname

Source changes are made through project storage and are used by the next deployment.

Runtimes

Cloudexa can detect common application types automatically.

Node.js
Detected from package.json. Usually started with npm start.
Python
Detected from Python source and dependency files.
PHP
Detected from PHP source or composer.json.
Ruby
Supported for Ruby applications with an appropriate start command.
Go
Go applications can be built during deployment and run from the project directory.
Java
Java projects can build and run using the configured project commands.
Static
Projects containing static HTML can be served directly.
server.js
const http = require("http");

const port = Number(process.env.PORT || 3000);

http.createServer((request, response) => {
    response.end("Hello from Cloudexa");
}).listen(port, "0.0.0.0");

Environment variables

Store application configuration and secrets as environment variables.

Environment variables are added to the application when its container starts.

Example
DATABASE_URL=postgresql://...
API_KEY=your-secret
NODE_ENV=production
Do not store secrets in project files

Passwords, API keys and access tokens should be stored as environment variables instead.

Ports

Web applications need to listen on the port Cloudexa provides.

Read the port from process.env.PORT when possible and bind the application to 0.0.0.0.

Use
server.listen(port, "0.0.0.0")
Avoid
Binding only to 127.0.0.1, which is not reachable from the proxy.

Logs

Build and runtime output is available from the hosting project.

Application output written to standard output or standard error appears in runtime logs.

JavaScript
console.log("Application started");

console.error("Something failed");

Domains

Hosted projects can use a Cloudexa hostname or a custom domain.

Add a custom domain from the project and configure the DNS records shown by Cloudexa.

DNS changes can take time

Cloudexa can only activate the domain after the required DNS records resolve correctly.

Databases

Cloudexa provisions PostgreSQL and MySQL databases separately from your application container.

Each database receives its own database name, username and generated password.

Database host
db.cloudexa.dev
PostgreSQL
Port 5432, with pgAdmin web access.
MySQL
Port 3306, with phpMyAdmin web access.
PostgreSQL URL
DATABASE_URL=postgresql://username:[email protected]:5432/database
MySQL URL
DATABASE_URL=mysql://username:[email protected]:3306/database
Keep database credentials private

A connection URL contains everything required to authenticate to the database.

PostgreSQL

PostgreSQL databases include normal connection credentials and pgAdmin access.

Host
db.cloudexa.dev
Port
5432
Web panel
pgadmin.cloudexa.dev
psql
psql \
  -h db.cloudexa.dev \
  -p 5432 \
  -U your_database_user \
  -d your_database

MySQL

MySQL-compatible databases can be managed with phpMyAdmin.

Host
db.cloudexa.dev
Port
3306
Web panel
phpmyadmin.cloudexa.dev
mysql
mysql \
  -h db.cloudexa.dev \
  -P 3306 \
  -u your_database_user \
  -p

Resource limits

Hosting limits depend on the account plan.

ResourceNormalPremium
Running instances210
Memory per instance512 MB2 GB
CPU per instance1 vCPU2 vCPU
Process limit2561,024
Build timeout10 min30 min
Databases15

CPU limits apply to containers on shared infrastructure. They are not dedicated physical CPU cores.

Container isolation

Hosted applications run separately from the Cloudexa host.

Host filesystem
Not mounted into the application container.
Docker socket
Not exposed to hosted applications.
Privileged mode
Disabled.
Linux capabilities
Restricted.

Applications can execute commands inside their own container, but they do not receive direct access to the Cloudexa host.

Troubleshooting

Common issues and the first thing to check.

Deployment stays on Building
Check the deployment logs. Dependency installation, runtime detection or the build command may have failed.
Application is running but cannot be opened
Confirm that the application listens on process.env.PORT and binds to 0.0.0.0.
Runtime was not detected
Check that the project storage contains the expected runtime files such as package.json, requirements.txt, composer.json or index.html.
Environment variable is missing
Add the variable from the hosting project's Environment section and redeploy the application.
PostgreSQL connection fails
Check db.cloudexa.dev:5432 and make sure the database name, username and password match the values shown by Cloudexa.
MySQL connection fails
Check db.cloudexa.dev:3306 and use the generated MySQL credentials.
Container exits immediately
Check runtime logs. The hosted service stops when its main process exits.