Deploy Node.js on CloudPloy
CloudPloy deploys Node.js apps from Git into Docker containers on your own server: a server in your AWS account, or a server you connect over SSH. Express, Fastify, Next.js, Nuxt and Astro apps all work the same way.
Deploy a Node.js app
- In the console, choose New app.
- Pick a repository from GitHub, GitLab or Bitbucket, or paste the URL of a public repository, and choose the branch.
- Leave the type on Detect automatically, pick the server and deploy.
You can also ask your AI agent to do this through the CloudPloy MCP server.
How CloudPloy builds a Node.js app
If the repository has a Dockerfile, CloudPloy builds it. If not, CloudPloy builds the app with Nixpacks, which installs your packages, runs thebuild script from package.json if there is one, and starts the app with the start script.
Listen on PORT
CloudPloy sets the PORT environment variable and sends traffic to that port. The default is 3000 for Node.js and Next.js apps and 4321 for Astro. Make your app listen on it, on all addresses:
const port = Number(process.env.PORT) || 3000;
app.listen(port, '0.0.0.0');Before CloudPloy sends traffic to a new container, it checks that the app answers on that port.
Environment variables
Set environment variables on the app page. Mark a value as Secret to store it encrypted; it cannot be viewed again after you save it. CloudPloy gives the app its values when it starts, plus PORT, APP_URL and PRIMARY_DOMAIN. Deploy again after you change a variable.
Deploys, logs and rollback
- Each deploy builds a new container. The old one keeps serving until the new one is ready. If a deploy fails, the old version stays live.
- Turn on automatic deploys on the app page to deploy on every push to the branch.
- The app page shows the build log of each deploy and the latest lines your app writes to stdout and stderr. Write your logs there, not to files.
- Use Rollback on the app page to go back to the version that was live before.
- Run more copies of the app with its Scale settings. CloudPloy does not scale apps automatically.
Domains
Every app gets an address under cloudploy-apps.link with HTTPS. To use your own domain, see Add a custom domain.
What CloudPloy does not do yet
- It does not run databases, Redis or other services for you. Use a database you run yourself and set its connection in the environment variables.
- It keeps no files between deploys. Each deploy starts a fresh container, so store uploads in object storage such as Amazon S3.
- It does not back up your app or your data.