Deploy a Node.js app from Git
Clone a Node.js project from GitHub or GitLab, create the app, build and deploy it, and ship updates with Pull updates and Build & deploy.
This tutorial puts a Node.js app (Next.js, Nuxt, Express, NestJS, a Vite build or any other) live on app.example.com
straight from its Git repository. Updates are then two clicks: Pull updates and Build & deploy.
You need:
- a hosting account on a server with Node.js installed (the Node.js apps screen does not say Node.js isn't installed on this server yet)
- the domain or subdomain the app will answer on, for example
app.example.com, added under Domains - the repository's
https://address. For a private repository, a personal access token from GitHub or GitLab.
1. Clone the repository
-
Open Control Panel › Software › Git.
-
Under New repository, fill in:
Field What to enter Clone from https://github.com/you/app.git. Private:https://TOKEN@github.com/you/app.git(the token is not stored with the address)Branch main, or leave empty for the default branchName appDeploy to leave empty: the Node.js app runs from the repository itself -
Click Create.
The code is now in ~/web/repositories/app. See Git.
2. Create the app
-
Open Software › Node.js apps.
-
Under New app, enter the App name
appand choose the Domainapp.example.com. -
Enter the App folder
web/repositories/app(wherepackage.jsonis). -
Click Detect from package.json. The framework is recognised and the fields are filled in. Check them:
Field Typical value Node.js the version your project needs Type Server app for Next.js, Nuxt, Express and other servers; Static site for a Vite, React or Vue build Install dependencies npm ci (uses package-lock.json) when the repository has a lock file Build script buildStart command server apps: for example npm startornode dist/main.jsMode Production -
Add your settings under Environment variables, one
NAME=valueper line, for exampleDATABASE_URL=…. -
Click Create app.
Important: a server app must listen on
process.env.PORT.PORT,HOSTandNODE_ENVare set for you.
3. Build and deploy
Click Build & deploy next to the app. A window shows every step: installing dependencies, building, and putting it live. A server app starts and shows Running; it restarts by itself if it crashes.
4. Get SSL and open it
Open Domains › SSL/TLS and check that app.example.com has a certificate (click Get free SSL if not). Then open
https://app.example.com.
If a server app doesn't come up, click Log file, or read ~/logs/node-app.log in the File Manager.
5. Ship an update
After you push new commits:
- On Software › Git, click Manage on the repository, then Pull updates.
- On Software › Node.js apps, click Build & deploy.
6. Add a database (optional)
Create one under Databases: MySQL, PostgreSQL or MongoDB. Put its connection details in the app's Environment variables with Settings, then click Build & deploy again.