Skip to content
Follow
Ubuntu Linux

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

Richard
Written by
Richard
Oct 10, 2022 Updated Jul 14, 2026 3 min read
How to Enable or Disable Microsoft Defender Cloud Protection
How to Enable or Disable Microsoft Defender Cloud Protection

Sails.js installs on Ubuntu to help you quickly build professional web apps.

Sails.js is a free framework for Node.js that makes creating data-heavy applications and real-time features much easier. It follows a “rules-based” system, so you don’t waste time on setup and can start coding sooner.

This guide shows you exactly how to get Sails.js running on your Ubuntu computer. We’ll cover everything needed so you can start building your first app right away.

⚡ Quick Answer

Install NVM, then use it to install Node.js LTS. Install Sails globally with `npm -g install sails`. Create a new app with `sails new my-app`, navigate to it, and run `sails lift` to start it.

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

📝Good to Know
With Node.js ready, install Sails globally on your system:

npm -g install sails

Check the installation by running:

sails --version

Create Sails app

Creating a Sails app on Ubuntu involves making a new folder for your project. You’ll then use the Sails command tool to set up your app’s basic structure. After selecting ‘Web App’ when prompted, navigate into your folder, install necessary files, and start the app using ‘sails lift’.

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

📝Good to Know
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
ubuntu linux install sails js web portal

Create Sails systemd service

You can make your Sails app start automatically when your Ubuntu server restarts by creating a systemd service file. This file ensures your app runs on its own after a reboot, so you don’t have to start it manually every time. Use the command ‘sudo nano /etc/systemd/system/geek-app.service’ to create and edit this file.

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

Running your Sails app behind a reverse proxy like Nginx or Apache is recommended for a production setup on Ubuntu. A reverse proxy helps manage incoming traffic safely and efficiently. You can set up Nginx or Apache for this purpose and also secure your site using Let’s Encrypt for added protection.

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?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips 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.

📚 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 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
How to Install Bitwarden on Ubuntu Linux
CMS How to Install Bitwarden on Ubuntu Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

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