Getting started
The shortest path from code to a running Cloudexa project.
- Create a project Choose a name and, optionally, build, start and port settings.
- Add your files Upload or edit the source from the project's Storage tab.
- 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.
/mnt/cloudexa-nas/projects/<project-id>/app
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.
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 withnpm 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.
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.
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.
- 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.
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 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.
DATABASE_URL=postgresql://username:[email protected]:5432/database
DATABASE_URL=mysql://username:[email protected]:3306/database
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 \
-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 \
-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 per instance | 512 MB | 2 GB |
| CPU per instance | 1 vCPU | 2 vCPU |
| Process limit | 256 | 1,024 |
| Build timeout | 10 min | 30 min |
| Databases | 1 | 5 |
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
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.