Your First Deploy
Let's deploy 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.comSet 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: '[email protected]', 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