What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Deploying Sails.js on an Ubuntu VPS is a five-part job: install a supported Node.js LTS runtime, copy the application and its production dependencies, run Sails in production mode, keep the process alive with PM2, and put Nginx in front of it for a stable public endpoint and HTTPS. The deployment is complete only when the app survives a shell logout and a server reboot, secrets are outside the repository, and the proxy forwards the headers and WebSocket traffic your app needs.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What the finished deployment looks like
A browser should never need to connect directly to the Node process. Instead, traffic follows this path:
As an Amazon Associate I earn from qualifying purchases.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall- A DNS record sends your domain to the VPS address.
- Nginx listens on the public HTTP and HTTPS ports, terminates TLS, and forwards requests to the Sails process on a private local port.
- PM2 starts the Sails application, restarts it after a crash, and restores it after a reboot.
- Sails runs with production configuration and a production-safe database migration policy.
You can substitute another reverse proxy or process manager, but the commands below use the components most commonly shown for a Sails deployment: Ubuntu, Node.js LTS, PM2, and Nginx.
| Layer | Responsibility | What you must decide |
|---|---|---|
| Ubuntu VPS | Operating system, users, firewall, updates | Server size, region, SSH access, and a non-root deployment user |
| Node.js LTS | Runs the Sails application | Use the LTS line supported by your Sails release; keep the version consistent across environments |
| Sails.js | Application framework and HTTP server | Which port the app binds to and which production configuration it loads |
| PM2 | Supervision, logs, restart, boot persistence | Application entry point, environment variables, and whether one instance is safest |
| Nginx | Public listener, proxy, TLS endpoint | Domain name, upstream port, HTTP-to-HTTPS redirect, and WebSocket support |
Prepare the Ubuntu VPS safely
Create a deployment account and update the host
Use SSH with a normal account that can run administrative commands through sudo. Keeping the application out of the root account limits the damage from a compromised dependency or configuration mistake.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
sudo apt update
sudo apt upgrade -y
sudo adduser deploy
sudo usermod -aG sudo deploy
Copy your SSH public key to the new account, test a second login in a separate terminal, and only then consider disabling password authentication or root login. Do not close your working root session until the new access path has been proven.
Choose the application port and directory
Pick a local port for Sails and use it consistently in the app configuration, PM2 command, and Nginx upstream. The examples use 1337 as a placeholder; replace it if your application listens elsewhere. Bind the app to the loopback interface when Nginx is on the same VPS so the Node port is not exposed directly to the internet.
Free tools Windows power users keep installed
One-click scans. No signup required.
sudo mkdir -p /var/www/sails-app
sudo chown -R deploy:deploy /var/www/sails-app
Keep the project in a versioned release directory if you need zero-downtime or quick rollback later. For a first deployment, /var/www/sails-app is sufficient.
Set a minimal firewall allow-list
Allow SSH and the two web ports. Do not open the internal Sails port to the world; Nginx can reach it locally.
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status verbose
Confirm your SSH rule before enabling UFW. If SSH uses a nonstandard port, allow that port instead of relying on the OpenSSH application profile.
Install a Node.js LTS runtime
Use the same major version you test
Sails behavior and native npm dependencies can vary with the Node release. Install a current Node.js LTS line that your application and Sails version support, and record the result so future deploys use the same runtime.
The Sails installation guidance describes using nvm. As the deployment user, install nvm through its current installation instructions, reopen the shell, and then run:
nvm install --lts
nvm alias default node
node --version
npm --version
The default alias makes the selected runtime available in new login shells. PM2 must also be installed under the same user and Node installation; installing PM2 as root while running the app as deploy creates a separate process list and commonly causes confusing startup failures.
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
npm install --global pm2
pm2 --version
Alternative system-wide installation
You may use a maintained NodeSource package or your distribution’s package manager instead of nvm. Whichever route you choose, avoid mixing package-manager Node, nvm Node, and a different Node binary in the PM2 startup service. Check the path PM2 reports and keep it stable across reboots.
Deploy the Sails project and its dependencies
Copy code without copying secrets
Pull the project with Git, upload an archive, or use your CI system. The repository should contain source code and lockfiles, not production passwords, API keys, database credentials, private certificates, or session secrets.
cd /var/www/sails-app
git clone <your-repository-url> current
cd current
If you deploy from an existing checkout, verify the commit or release tag before installing. A repeatable deployment records the commit, Node version, npm version, and configuration revision.
Install production dependencies
Use the lockfile when one exists. With a current npm release, this installs the locked dependency tree while omitting development-only packages:
npm ci --omit=dev
If the project does not have a lockfile, use the installation command appropriate to the package manager and commit the resulting lockfile before the next release. Do not delete packages merely because they look unused: Sails build tasks, adapters, and hooks can be required at runtime. Run any required asset-build or migration preparation step documented by your project before starting the server.
Provide environment variables
Keep environment-specific values outside Git. A simple approach is a root-readable file owned by the deployment account, with restrictive permissions:
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minutecd /var/www/sails-app/current
umask 077
cat > .env.production <<'EOF'
NODE_ENV=production
PORT=1337
# Add database, session, and third-party credentials here.
EOF
chmod 600 .env.production
Whether Sails reads a dotenv file automatically depends on your project and its configuration. If it does not, define the variables through PM2’s environment configuration or your service manager. Never assume that creating .env.production alone makes values available to Node.
Start Sails in production mode
Use one unambiguous production setting
The standard production switch is NODE_ENV=production. Sails also supports sails lift --prod; that flag sets NODE_ENV to production when it has not already been set. Do not combine contradictory settings. For example, an existing NODE_ENV=development together with --prod causes the application to fail rather than silently choosing one.
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
cd /var/www/sails-app/current
NODE_ENV=production node app.js
Alternatively, when the Sails CLI is installed and your project uses it:
NODE_ENV=production npx sails lift --prod
Run the command in the foreground once. Confirm that the app binds to the expected port, connects to its dependencies, and serves a health route before adding PM2. Stop it with Ctrl+C after the smoke test.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Understand what production mode changes
- Sails forces model migrations to the
safestrategy in production. Existing data is not automatically altered by an unsafe migration setting. - Error responses produced by
res.serverError()are logged, but production responses do not send stack traces to the client. - The production task minifies assets.
These defaults protect a public deployment, but they do not replace a deliberate database migration process. Back up the database and run schema changes through the migration method your application uses.
Keep the app alive with PM2
Start the process
From the release directory, start the same entry point that worked in the foreground test. The following mirrors the common Sails pattern; adjust the filename and port to your project:
cd /var/www/sails-app/current
pm2 start app.js --name sails-app -- --prod
The double dash separates PM2 options from arguments passed to your application. If your app relies on an explicit environment rather than the Sails flag, use an ecosystem file so the setting is visible and repeatable:
module.exports = {
apps: [{
name: 'sails-app',
script: 'app.js',
cwd: '/var/www/sails-app/current',
instances: 1,
exec_mode: 'fork',
env: {
NODE_ENV: 'production',
PORT: 1337
}
}]
};
Save that file outside the public document root, add secrets through the deployment environment, and start it with pm2 start ecosystem.config.js. Do not commit credentials to the ecosystem file.
Inspect logs and restart behavior
pm2 status
pm2 logs sails-app
pm2 restart sails-app
pm2 describe sails-app
Look for a listening-port message, successful database initialization, and the absence of an immediate restart loop. A process shown as “online” can still return application errors, so test the HTTP endpoint locally as well as through Nginx.
Persist the process list across reboots
pm2 save
pm2 startup
The second command prints a platform-specific command that must be run with sudo. Copy that generated command exactly, then run pm2 save again after any later process-name or environment change. The exact startup command varies with the Node installation path and PM2 release; verify the generated output rather than pasting a command from a different server.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Why a single instance is the cautious default
Do not enable PM2 cluster mode merely to use every CPU core. An older Sails forum report describes multiple processes conflicting over the shared .tmp directory. That report is dated, and whether the behavior applies to your current Sails release is unresolved. Start with one forked process, measure the workload, and only test multiple instances after confirming that your Sails version, adapters, sessions, uploads, sockets, and temporary-file handling are safe for concurrent workers.
Recommended Free Tools
Configure Nginx as the reverse proxy
Create a server block
Install Nginx and create a site configuration. Replace example.com and the upstream port with your real values.
sudo apt install nginx
sudo nano /etc/nginx/sites-available/sails-app
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
location / {
proxy_pass http://127.0.0.1:1337;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
The forwarded headers preserve the original host, client address chain, and scheme. The last two headers allow upgrade requests used by WebSocket-based features; retaining them is harmless for ordinary HTTP requests in this simple configuration.
Enable and validate the site
sudo ln -s /etc/nginx/sites-available/sails-app /etc/nginx/sites-enabled/sails-app
sudo nginx -t
sudo systemctl reload nginx
If the default site catches the request first, remove or disable that site only after confirming your new server_name is correct. A failed nginx -t must be fixed before reloading; never reload a configuration you have not validated.
Set Sails trustProxy only when a proxy is really in front
Sails exposes Express’s proxy setting through sails.config.http.trustProxy. It controls whether the framework trusts X-Forwarded-* headers when deciding the client IP, protocol, and secure-cookie behavior.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Direct HTTP or direct HTTPS
If clients connect directly to Sails and no reverse proxy terminates the connection, leave trustProxy undefined. Trusting arbitrary forwarded headers on a direct-facing app lets clients spoof information the application may use for redirects, logging, rate limits, or cookies.
HTTPS terminated by Nginx
When Nginx receives HTTPS and forwards an internal HTTP request, configure trustProxy so Sails can correctly interpret the forwarded protocol. The Sails documentation suggests starting with true behind a proxy and consulting the more restrictive options if that does not match your topology.
// config/http.js
module.exports.http = {
trustProxy: true
};
Use a narrower trust rule when you have multiple proxies or a network where untrusted clients can reach the upstream directly. The setting must match the actual proxy chain; it is not a universal “make HTTPS work” switch.
Best Value
Add HTTPS after HTTP proxying works
Point DNS first
Create an A or AAAA record for the domain that resolves to the VPS. Verify that both the bare domain and any www name listed in server_name resolve correctly before requesting a certificate.
Obtain and install a certificate
Let’s Encrypt certificates are commonly installed with Certbot and an Nginx integration package. Package names and the recommended installation channel vary by Ubuntu release, so follow the current Certbot instructions for your distribution. The certificate request must be able to reach the server on port 80 or use the challenge method you selected.
After installation, inspect the generated Nginx configuration and test it:
sudo nginx -t
sudo systemctl reload nginx
Ensure renewal is scheduled and perform a renewal dry run according to the Certbot guidance for your installation. Treat renewal as an operational dependency: an expired certificate makes an otherwise healthy Sails process unreachable to browsers.
Redirect plain HTTP
Once HTTPS serves correctly, change the port-80 server block to redirect to the HTTPS host while leaving the ACME challenge path available if your renewal method needs it. Do not enable the redirect before you have verified that the certificate and HTTPS virtual host work.
Verify the deployment from the inside out
- Check the process: run
pm2 statusand confirm the process is online without repeated restarts. - Check the local port: from the VPS, request
http://127.0.0.1:1337or your configured health endpoint withcurl. A local failure is an application or PM2 problem, not an Nginx problem. - Check Nginx: inspect the Nginx error log if the local request works but the public request returns 502 or 504.
- Check the public name: request the HTTPS URL and verify the expected host, redirect, cookies, and static assets.
- Check sockets: if the app uses Socket.io or another WebSocket feature, exercise a real connection through the public HTTPS endpoint.
- Check reboot persistence: reboot during a maintenance window, then verify Nginx, PM2, the Sails process, and the health endpoint.
Troubleshoot common failures
| Symptom | Likely cause | Checks and fix |
|---|---|---|
| PM2 exits immediately | Wrong entry point, missing dependency, or conflicting environment | Run the same command in the foreground; inspect pm2 logs sails-app; confirm NODE_ENV is not development while using --prod. |
| “Address already in use” | Another process owns the configured port | Inspect the listening process, stop the duplicate, or choose a different port and update both PM2 and Nginx. |
| Nginx returns 502 | Sails is stopped, listening on another address, or using another port | Test the upstream locally, verify the PM2 working directory, and compare the Nginx proxy_pass value with the app’s actual listener. |
| HTTPS redirects loop | Sails does not recognize the original HTTPS scheme | Confirm Nginx sends X-Forwarded-Proto and configure trustProxy only for this trusted proxy path. |
| Client IPs are all the proxy address | Forwarded headers are missing or not trusted | Check X-Forwarded-For in Nginx and the Sails trustProxy setting; do not trust headers on a directly exposed app. |
| WebSockets fail while pages work | Upgrade headers or long-lived proxy behavior is absent | Confirm the HTTP/1.1, Upgrade, and Connection proxy headers, then test through the TLS virtual host. |
| Changes disappear after reboot | PM2 process list was not saved or startup was not installed for the current user | Run the generated pm2 startup command with sudo, then run pm2 save as the deployment user. |
| Database schema changes unexpectedly | Production was not actually enabled | Check the effective environment and start command. Production Sails forces migrations to safe; do not rely on development migration behavior. |
Release and maintenance practices
Use a repeatable release sequence
- Build and test the exact commit in a non-production environment with the same Node LTS major version.
- Back up the production database and confirm that required environment variables exist.
- Pull the new commit into a new release directory rather than overwriting the running checkout.
- Run the lockfile-based production install and any documented asset build.
- Run a foreground smoke test or a temporary PM2 process on a separate local port.
- Switch the PM2 working directory to the new release, restart, and inspect logs.
- Exercise the local health endpoint, then the public HTTPS endpoint.
- Retain the previous release until the new one has passed its checks, so rollback is a directory switch and PM2 restart rather than a hurried rebuild.
Protect logs and secrets
PM2 logs can contain request data or stack traces. Set retention and rotation appropriate to your disk, restrict access to the deployment and administrator accounts, and avoid logging credentials. Rotate secrets if they ever appear in a repository, shell history, CI output, or publicly accessible log.
Recheck version-sensitive behavior
Node.js LTS releases, Sails defaults, PM2 startup integration, Nginx package behavior, and certificate tooling all change over time. Before a major upgrade, read the documentation for the exact Sails and Node versions you run, repeat the production-mode and trustProxy checks, and test a rollback path.
Deployment checklist
- Ubuntu is updated and SSH access for the non-root deployment user works.
- UFW allows only the required SSH, HTTP, and HTTPS paths.
- Node.js is an appropriate LTS release and
node --versionis recorded. - The project and lockfile are deployed without secrets committed to Git.
- Production dependencies are installed and required assets are built.
NODE_ENV=productionorsails lift --prodis used without a conflicting environment.- The app responds on its local port before Nginx is involved.
- PM2 starts the correct entry point, logs are clean, and the process list is saved.
- Nginx passes
nginx -t, forwards the host and scheme headers, and supports WebSockets if needed. trustProxyis configured only because a trusted HTTPS proxy is in front of Sails.- DNS, certificate issuance, renewal, redirects, and reboot recovery have all been tested.
Conclusion
A reliable Sails.js VPS deployment separates concerns: Sails serves the application, PM2 supervises it, Nginx provides the public edge, and Ubuntu supplies the secured host. Build the chain from the inside out, keep production mode explicit, avoid exposing the Node port, and validate every layer locally before adding the next one. That approach makes failures diagnosable and gives you a straightforward rollback when a release or configuration change goes wrong.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




