Documentation

Reference for Cloudexa repositories, hosting, databases and deployment configuration.

Getting started

The shortest path from code to a running Cloudexa project.

Create a repository Create one from Cloudexa, then push your files with Git.
Create a project Choose the repository, branch and hosting settings.
Deploy Cloudexa syncs the source, runs the build and starts the application.

Repositories

Cloudexa repositories are normal Git repositories and can be used directly as deployment sources.

Repositories can be public or private. Hosting projects reference one repository and branch.

Clone
git clone https://cloudexa.dev/git/username/project.git
cd project
Push changes
git add .
git commit -m "Update project"
git push origin main
Private repositories

Private repositories require authentication when cloning or pushing. Use your Cloudexa Git credentials or access token.

Deployments

A deployment starts from the selected repository and branch.

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

Deployment flow
repository
  -> checkout
  -> sync tracked source changes
  -> build in /app
  -> start container
  -> route hostname

Runtime-created files are not copied back into Git. Normal redeployments preserve the persistent application directory.

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(
    (req, res) => {
        res.end(
            "Hello from Cloudexa"
        );
    }
).listen(
    port,
    "0.0.0.0"
);

Environment variables

Store application configuration and secrets without committing them to the repository.

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

Example
DATABASE_URL=postgresql://...
API_KEY=your-secret
NODE_ENV=production
Do not commit secrets

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 server.listen(port, "127.0.0.1")

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 can provision 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:password@db.cloudexa.dev:5432/database
MySQL URL
DATABASE_URL=mysql://username:password@db.cloudexa.dev: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.

Resource Normal Premium
Running instances 2 10
Memory / instance 512 MB 2 GB
CPU / instance 1 vCPU 2 vCPU
Process limit 256 1,024
Build timeout 10 min 30 min
Databases 1 5

CPU limits apply to containers running 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 repository 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.
Copied