A complete tutorial for deploying your first application with ShipNode.
By the end of this tutorial, you'll have a Node.js Express API running on your server with:
- Zero-downtime deployments
- Automatic HTTPS
- Health check monitoring
- Rollback capability
- A server with SSH access (Ubuntu/Debian)
- A domain name (optional, but recommended)
- DNS configured to point to your server's IP
Make sure your server has:
- SSH access (password or key)
- Port 22 open (default SSH)
- Ports 80 and 443 open (for HTTP/HTTPS)
If you don't have an existing project, create one:
mkdir myapi && cd myapi
npm init -y
npm install expressCreate index.js:
const express = require('express');
const app = express();
app.get('/health', (req, res) => {
res.json({ status: 'ok' });
});
app.get('/', (req, res) => {
res.json({ message: 'Hello from ShipNode!' });
});
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});Update package.json:
{
"name": "myapi",
"scripts": {
"start": "node index.js"
}
}shipnode initFill in the prompts:
Application type: backend
SSH user: your-username
SSH host: your-server-ip
SSH port: 22
Remote path: /var/www/myapi
PM2 name: myapi
Backend port: 3000
Domain: api.yourdomain.com (optional)
This creates shipnode.conf in your project.
shipnode setupWait for the setup to complete. This installs:
- Node.js 20 LTS
- PM2
- Caddy
shipnode deployYou'll see output like:
[+] Syncing files to server...
[+] Installing dependencies...
[+] Building...
[+] Switching to new release...
[+] Running health check...
[+] Deployment successful!
Check your deployment:
shipnode statusVisit https://api.yourdomain.com (or http://your-server-ip).
Edit your code, then deploy again:
shipnode deployShipNode will:
- Create a new timestamped release
- Switch the
currentsymlink atomically - Run a health check
- Keep the old release for rollback
If something goes wrong:
shipnode rollbackShipNode switches back to the previous release instantly.
- Add a Database - Configure PostgreSQL, MySQL, SQLite, or Redis
- Custom Templates - Customize PM2/Caddy
- Health Checks - Configure health endpoints
- CI/CD - Automate deployments with GitHub Actions