Your First Deploy
This page walks through deploying your first Sails.js application with Slipway.
Prerequisites
Before deploying, make sure:
- You have a Sails.js application ready
- Your app has a
Dockerfilein the root directory - The Slipway CLI is installed and authenticated
Need a Dockerfile?
If your Sails app doesn't have a Dockerfile yet, here's a simple one to get started:
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
EXPOSE 1337
CMD ["node", "app.js"]Initialize Your Project
Navigate to your Sails project and initialize it with Slipway:
cd ~/projects/my-sails-app
slipway initThis will:
- Prompt you for a project name (defaults to your package.json name)
- Check for a Dockerfile
- Create the project in Slipway
- Save a
.slipway.jsonconfig file locally
Initialize Slipway Project
Project name: my-sails-app
✓ Project created
Project: My Sails App
Slug: my-sails-app
Environment: production
Run slipway slide to deploy your app.Linking to Existing Projects
If the project already exists in Slipway (e.g., created via the dashboard), use slipway link instead:
slipway link my-sails-appDeploy Your App
Navigate to your Sails project directory and deploy:
cd ~/projects/my-sails-app
slipway slideYou'll see the deployment progress:
$ slipway slide
Sliding my-sails-app into production
✓ Deployment started
Deployment ID: abc12345
Building...
Deploying...
✓ Deployment successful
URL: https://my-sails-app.example.comVerify Direct Access
Slipway assigns the deployment a direct URL using a port from 1338–1500. Test it from your computer or another network so the request crosses the provider firewall:
curl -I --connect-timeout 5 http://YOUR_SERVER_IP:ALLOCATED_PORT/healthA successful health response confirms that the app is running and the allocated port is reachable publicly. If the deployment log confirms a healthy container and a live Docker mapping but this request times out, allow the allocated port in both the VPS provider firewall and any active host firewall.
Custom Domains
Direct URLs are useful during setup and troubleshooting. Applications with a custom domain receive traffic through ports 80 and 443 instead.
Set Environment Variables
Most Sails apps need environment variables. Set them before or after deploying:
# Set individual variables
slipway env:set myapp DATABASE_URL=postgres://...
slipway env:set myapp SESSION_SECRET=your-secret-key
slipway env:set myapp NODE_ENV=production
# Or set multiple at once
slipway env:set myapp \
DATABASE_URL=postgres://... \
SESSION_SECRET=your-secret-key \
NODE_ENV=productionRedeploy After Env Changes
After changing environment variables, redeploy your app for the changes to take effect:
slipway slideAdd a Custom Domain
Give your app a proper domain:
slipway domain:add myapp myapp.example.comThen point your DNS to your Slipway server's IP address. SSL will be provisioned automatically via Caddy.
View Logs
Check your application logs:
# View recent logs
slipway logs myapp
# Tail logs in real-time
slipway logs myapp -tOpen the Helm (REPL)
Need to debug or query your production data? Open the Helm:
slipway helm myappSlipway Helm (myapp production)
Type .help for available commands
> await User.count()
42
> await User.find({ role: 'admin' })
[
{ id: 1, email: 'admin@example.com', role: 'admin' }
]Deploy from Dashboard
You can also trigger deployments from the Slipway dashboard:
- Go to your project
- Click the Deploy tab
- Slide to deploy (or click the deploy button)
The dashboard shows deployment history, logs, and status.
What's Next?
Congratulations! Your first Sails app is deployed. Next steps:
- Set up a database with one-click provisioning
- Configure rollbacks for quick recovery
- Explore the Bridge for data management
- Learn more CLI commands