Ubuntu Linux

Install Sails.js on Ubuntu: A Step-by-Step Guide

Richard
Written by
Richard
Oct 10, 2022 Updated Apr 18, 2026 2 min read
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.

Terminal window showing the installation process of Sails.js on Ubuntu Linux

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:

💻Code
[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?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, the owner and lead writer at Geek Rewind, is a tech enthusiast passionate about simplifying complex IT topics. His years of hands-on experience in system administration and enterprise IT operations have honed his ability to provide practical insights and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

2458 articles → Twitter

📚 Related Tutorials

How to Install ClamAV Linux Antivirus on Ubuntu Linux
Ubuntu Linux How to Install ClamAV Linux Antivirus on Ubuntu Linux
How to Install Apache OpenMeetings on Ubuntu Linux
Ubuntu Linux How to Install Apache OpenMeetings on Ubuntu Linux
How to Install BoxBilling with Apache on Ubuntu Linux
Ubuntu Linux How to Install BoxBilling with Apache on Ubuntu Linux
How to Install LibreOffice on Ubuntu Linux
Ubuntu Linux How to Install LibreOffice on Ubuntu Linux

Leave a Reply

Your email address will not be published. Required fields are marked *