Skip to main content
This guide walks you through deploying an Express.js application on DCDeploy, including setup, build configuration, and best practices.

Quick Start: Hello World

You can try deploying a minimal Express.js app to test the workflow.
  1. Create a new project:
  2. Create an index.js file with the following code:
  1. Update package.json scripts:
  1. Run locally:
  1. Commit and push to GitHub/Git provider.
  2. Deploy on DCDeploy using the steps in the guide below.

Overview

Express.js is a lightweight Node.js web framework often used for REST APIs and backend services. On DCDeploy, you can deploy Express.js apps using:
  • Build from Code (auto-detected Node.js project) – easiest method.
  • Custom Dockerfile – for advanced control over runtime and dependencies.

Prerequisites

  • Express.js project (index.js or app.js entrypoint).
  • package.json with a valid start script.
  • GitHub (or Git) repository to push your project.
  • (Optional) Dockerfile if you want a custom build.

Step-by-Step Guide

  1. Prepare Your Express App
  • Ensure package.json has a start script that runs your server.
  • App must listen on 0.0.0.0 and use the PORT environment variable.
  1. Add Dockerfile (optional)
  1. Push Code to Git
  • Initialize Git, commit files, and push to your Git provider.
  • Add .dockerignore if using Docker.
  1. Deploy on DCDeploy
  • In DCDeploy dashboard → Deploy tab of your environment.
  • Create a new service → select Build from Code or Docker Registry.
  • Provide repo + branch.
  • Set port to 3000 (or the one used in your app).
  • Configure environment variables for secrets, DB URLs, etc.
  • Choose machine type (CPU, RAM) based on traffic needs.
  • Deploy and monitor logs.

Example Service Config

Best Practices

  • Use environment variables (not hardcoded secrets).
  • Use internal networking in DCDeploy to connect databases/APIs securely.
  • Add health check endpoints (e.g. /healthz).
  • Log errors clearly for debugging.
  • Scale services with minScale/maxScale depending on workload.

Troubleshooting