Documentation
Reference for Cloudexa repositories, hosting, databases and deployment configuration.
Getting started
The shortest path from code to a running Cloudexa project.
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.
git clone https://cloudexa.dev/git/username/project.git
cd project
git add .
git commit -m "Update project"
git push origin main
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.
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.
package.json. Usually started with npm start.
composer.json.
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.
DATABASE_URL=postgresql://...
API_KEY=your-secret
NODE_ENV=production
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.
server.listen(port, "0.0.0.0")
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.
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.
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.
db.cloudexa.dev
5432, with pgAdmin web access.
3306, with phpMyAdmin web access.
DATABASE_URL=postgresql://username:password@db.cloudexa.dev:5432/database
DATABASE_URL=mysql://username:password@db.cloudexa.dev:3306/database
A connection URL contains everything required to authenticate to the database.
PostgreSQL
PostgreSQL databases include normal connection credentials and pgAdmin access.
db.cloudexa.dev
5432
pgadmin.cloudexa.dev
psql \
-h db.cloudexa.dev \
-p 5432 \
-U your_database_user \
-d your_database
MySQL
MySQL-compatible databases can be managed with phpMyAdmin.
db.cloudexa.dev
3306
phpmyadmin.cloudexa.dev
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.
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
Application is running but cannot be opened
process.env.PORT and binds to 0.0.0.0.
Runtime was not detected
package.json, requirements.txt, composer.json or index.html.
Environment variable is missing
PostgreSQL connection fails
db.cloudexa.dev:5432 and make sure the database name, username and password match the values shown by Cloudexa.
MySQL connection fails
db.cloudexa.dev:3306 and use the generated MySQL credentials.