Install Sails.js on Ubuntu: A Step-by-Step Guide
This guide helps you set up the Sails.js framework on Ubuntu Linux for 2026. Sails makes it simple to build powerful, professional web applications.
Why use Sails.js? It allows you to build data-driven APIs and real-time apps using a structure that is easy to manage. What happens when done? You will have a running web application accessible through your browser.
Sails supports databases like MySQL, PostgreSQL, MongoDB, and Redis.
Install NVM
Node Version Manager (NVM) lets you manage different versions of Node.js easily. Run this command to install the latest stable NVM version:
curl -sL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh -o install_nvm.sh | bash install_nvm.sh
Next, update your bash profile:
source ~/.bashrc
Install Node.js
Now, use NVM to install the current Active LTS version of Node.js:
nvm install --lts
Install Sails.js
With Node.js ready, install Sails globally on your system:
npm -g install sails
Check the installation by running:
sails --version
Create Sails app
Create your first project folder:
sails new geek-app
Select “Web App” when prompted. Navigate into your folder, install dependencies, and start the app:
cd geek-app
npm install
sails lift
Check the official Sails.js documentation for current database adapter compatibility and potential Docker deployment alternatives. Open your browser to http://localhost:1337 to see your app.

Create Sails systemd service
A systemd service allows your app to start automatically when the server reboots. Create a file with this command:
sudo nano /etc/systemd/system/geek-app.service
Paste the following into the file. Replace $USER with your actual system username:
[Unit] Description=Sails.js App After=network.target [Service] Type=simple User=$USER WorkingDirectory=/home/$USER/geek-app ExecStart=/bin/bash -c "source /home/$USER/.nvm/nvm.sh && npm start" Restart=on-failure [Install] WantedBy=multi-user.target
Reload the system and start your service:
sudo systemctl daemon-reload
sudo systemctl enable geek-app --now
You can now manage your app with sudo systemctl stop geek-app or sudo systemctl start geek-app.
Using reverse proxy
For production, run Sails behind a reverse proxy. See these guides for Nginx or Apache:
How to set up a reverse proxy with Nginx
How to set up a reverse proxy with Apache
You may also secure your site with Let’s Encrypt:
Set up Let’s Encrypt with Nginx
Set up Let’s Encrypt with Apache
Conclusion
You have successfully installed Sails.js and configured it to run as a background service on Ubuntu. Your environment is now ready for professional web development.
[Unit] [Service] [Install] [22377] [22377] [22377] [22377] [22377] [22377] [22377] [22377] [22377]
Was this guide helpful?
Leave a Reply Cancel reply