App Hosting turns git push into a production deploy. Let's ship a Node.js app.
1. Prepare your app
Your package.json needs a start script and should listen on the PORT environment variable:
// server.js
const express = require('express')
const app = express()
app.get('/', (req, res) => res.send('Hello from Hostn.ME!'))
app.listen(process.env.PORT || 3000)
{
"scripts": { "start": "node server.js" },
"engines": { "node": "20.x" }
}
2. Create the app
- Dashboard → Apps → New App
- Connect GitHub or GitLab and pick your repository
- We auto-detect Node.js and suggest build/start commands:
- Build:
npm ci && npm run build(if a build script exists) - Start:
npm start
- Build:
- Click Deploy
3. Add environment variables
Under Settings → Environment, add secrets like DATABASE_URL or API_KEY. They're encrypted and injected at runtime — never commit them to Git.
4. Attach a database
Click Add-ons → PostgreSQL. A DATABASE_URL variable is created for you automatically.
5. Custom domain + SSL
Settings → Domains → Add Domain, then create a CNAME:
CNAME app your-app.hostn.app
SSL is issued automatically.
6. Every push deploys
git add .
git commit -m "New feature"
git push origin main # → build → health check → live
Pull requests get their own preview URL on the Launch and Scale plans. Something broke? Click Rollback to restore the previous release instantly.
Stuck on a step?
Our AI assistant knows every tutorial, and a real engineer is one click away.