Recommended Free Tools
The dependable way to run a Next.js application on a Linux VPS is to build it with Node.js, run the production server on a private localhost port, supervise that process with PM2 or systemd, and put Nginx in front of it for public HTTP and HTTPS traffic. This arrangement supports the full Next.js feature set while keeping the application port off the internet.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
The deployment architecture
A VPS deployment separates application execution from public traffic handling. Your Next.js process listens on a private address such as 127.0.0.1:3000. Nginx listens on ports 80 and 443, terminates TLS, applies request controls, and forwards valid requests to Next.js. PM2 or systemd starts the application at boot and restarts it after a crash.
As an Amazon Associate I earn from qualifying purchases.
- DNS: Your domain’s A record (and, if used, AAAA record) points to the VPS public IP address.
- Nginx: Accepts internet traffic, redirects HTTP to HTTPS, and proxies requests to the local application port.
- Process manager: Keeps the Node.js process running and restores it after a reboot.
- Next.js: Serves the optimized production build generated by
next build. - Operating system: Supplies updates, firewall rules, users, logs, storage, and backups.
Next.js documentation recommends a reverse proxy such as Nginx instead of exposing the Next.js server directly. A proxy can reject malformed requests, enforce payload limits, absorb slow-connection behavior, and provide rate-limiting controls before requests reach your application.
Choose how Next.js will run
Decide the deployment mode before configuring the VPS. The three common choices have different feature coverage and operational costs.
#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.
| Mode | Feature coverage | Operational work | Proxy and storage considerations | Best fit |
|---|---|---|---|---|
| Node.js server | Supports all Next.js features, including server-rendered routes, route handlers, and dynamic behavior. | Install Node.js, build the project, supervise the process, and maintain the host. | Use a reverse proxy for public traffic. A single process does not automatically provide shared cache or durable distributed storage. | Most dynamic applications hosted directly on a VPS. |
| Docker | Also supports all Next.js features when the image runs the production server. | Build and update images, manage containers, logs, networking, and persistent volumes. | Put Nginx or another proxy in front of the container. Use Next.js’s standalone output pattern for a smaller production image. | Teams that need repeatable packaging or the same artifact across environments. |
| Static export | Limited to features that can be generated as static files; no server-only behavior or runtime server rendering. | Run an export build and serve the resulting files from Nginx or Apache. | No Node.js process is required in production. Dynamic data, server actions, and other server features need a different design. | Sites whose pages can be completely generated ahead of time. |
For a typical VPS-hosted application with dynamic routes, use the Node.js server path. Docker is an alternative packaging method rather than a different Next.js feature set. Static export is appropriate only when its feature limits match the application.
Prerequisites and DNS
What you need before logging in
- A Linux VPS with a supported distribution and enough CPU, memory, and disk for your build, dependencies, logs, and uploaded data.
- Administrative SSH access, preferably using an SSH key rather than a password.
- A domain name under your control.
- A Next.js project whose
package.jsoncontains workingbuildandstartscripts. The official Node.js deployment flow isnpm run buildfollowed bynpm run start. - The Node.js release required by your project’s Next.js version and lockfile. Do not choose a Node release solely because it is the newest one.
Point the domain at the VPS
Create an A record for the hostname you will publish, such as app.example.com, pointing to the VPS IPv4 address. Add an AAAA record only when the server is correctly configured for IPv6. If you use the bare domain as well, configure its record separately and decide whether Nginx should redirect one hostname to the other.
DNS changes can take time to appear at different resolvers. Verify resolution from a network outside the VPS before requesting a certificate. A certificate authority must be able to reach the hostname over the public web.
Prepare the Linux VPS securely
Create a non-root deployment account
Use root only for operating-system administration. Create a dedicated account for the application, add it to the administrative group used by your distribution, and install your SSH public key for that account. Confirm that a second SSH session works before disabling root login or password authentication.
sudo adduser deploy
sudo usermod -aG sudo deploy
sudo install -d -m 700 -o deploy -g deploy /home/deploy/.ssh
sudo install -m 600 -o deploy -g deploy /tmp/deploy_authorized_keys /home/deploy/.ssh/authorized_keys
The final key-installation command assumes you have securely copied your public-key file to the server. Use your distribution’s documented administrative group if it is not named sudo.
Apply updates and install basic tools
sudo apt update
sudo apt upgrade
sudo apt install nginx git curl ca-certificates ufw
Package names differ on non-Debian distributions. Install the equivalent Nginx, Git, curl, certificate, and firewall packages from that distribution.
Free tools Windows power users keep installed
One-click scans. No signup required.
Configure the firewall before exposing the site
Allow SSH before enabling the firewall so you do not lock yourself out. Permit only the public web ports and SSH; the Next.js port should remain local.
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status verbose
If your SSH service uses a nonstandard port, allow that port instead of the OpenSSH profile. Keep port 3000 out of the firewall rules and bind the app to localhost as an additional safeguard.
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.
Install a compatible Node.js runtime
Read the Next.js and project documentation to identify the supported Node.js range. Install that release using your distribution’s maintained packages or a version manager approved by your team. The lockfile and package manager must be available to the deployment account.
Check the versions after installation:
node --version
npm --version
Do not mix package managers during deployment. If the repository contains package-lock.json, use npm; if it contains a pnpm or Yarn lockfile, use the corresponding tool and its frozen-lockfile option.
Upload the application and install dependencies
Create an application directory
sudo mkdir -p /var/www/next-app
sudo chown -R deploy:deploy /var/www/next-app
cd /var/www/next-app
Upload the repository with your normal Git, CI, or secure file-transfer workflow. Keep the working tree owned by the deployment user so builds and restarts do not create root-owned files.
Install exactly what the lockfile specifies
cd /var/www/next-app
npm ci
npm ci provides a reproducible install when the lockfile is current. It installs development dependencies as well, which are often needed to run the production build. If you use pnpm or Yarn, use that project’s frozen-lockfile equivalent instead.
After the build succeeds, you can remove development dependencies only if your application does not need them at runtime and your process manager does not invoke build tooling on startup. Never remove a package that is required by a server route or custom runtime.
Set environment variables safely
Separate values needed while building from values needed only when the server runs. A file such as .env.production can hold server-side settings on the VPS, but it must be readable only by the deployment account and must not be committed to source control.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchescd /var/www/next-app
umask 077
nano .env.production
chmod 600 .env.production
Keep database credentials, signing keys, and private API tokens in server-only variables. Any variable prefixed with NEXT_PUBLIC_ is intended for browser exposure and is inlined into the client bundle during next build. It is not a secret. Changing such a value requires another build and deployment; changing a server-only runtime value can be handled by restarting the process, provided the application reads it at runtime.
Do not print environment files in shell history or logs. For a larger team, inject secrets through the service manager or a secrets system rather than distributing plaintext files.
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
Build and test the production server
Run the build as the deployment user:
cd /var/www/next-app
npm run build
A successful build creates the optimized production output. Start it locally on a private port and verify it before configuring Nginx:
npm run start -- --hostname 127.0.0.1 --port 3000
In another SSH session, request the local endpoint:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
curl -I http://127.0.0.1:3000
Stop the foreground process with Ctrl-C after testing. If the start script rejects the hostname or port flags, put equivalent options in the script or use the HOSTNAME and PORT environment variables supported by your Next.js release. The important properties are a production start command and a listener reachable only from the VPS itself.
Keep Next.js running with PM2
PM2 is a practical process supervisor for a single VPS. Install it for the deployment account, define the command and environment in an ecosystem file, then save the process list so it is restored at boot.
npm install --global pm2
cd /var/www/next-app
nano ecosystem.config.js
Use an ecosystem file like this, adjusting the application name and working directory:
module.exports = {
apps: [{
name: 'next-app',
cwd: '/var/www/next-app',
script: 'npm',
args: 'run start -- --hostname 127.0.0.1 --port 3000',
env: {
NODE_ENV: 'production'
}
}]
};
Start and inspect the process:
pm2 start ecosystem.config.js
pm2 status
pm2 logs next-app
pm2 save
pm2 startup
The final command prints a distribution-specific command. Run that printed command with the administrative privileges it requests, then run pm2 save again. Test a controlled restart with pm2 restart next-app and confirm that the application returns a successful response.
PM2 logs are useful for application errors, but configure log rotation and retention so a busy server cannot fill its disk.
Use systemd instead of PM2 when preferred
Systemd is already present on most mainstream Linux distributions and provides native dependency ordering, restart policies, and journal logging. Create /etc/systemd/system/next-app.service as root:
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.
[Unit]
Description=Next.js production application
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/var/www/next-app
Environment=NODE_ENV=production
Environment=PORT=3000
ExecStart=/usr/bin/npm run start -- --hostname 127.0.0.1 --port 3000
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Confirm the paths with command -v npm; a version manager may place npm somewhere other than /usr/bin/npm. Then load and enable the unit:
sudo systemctl daemon-reload
sudo systemctl enable --now next-app
sudo systemctl status next-app
sudo journalctl -u next-app -f
Choose one supervisor, not both. Running PM2 and systemd against the same port creates competing processes and confusing restarts.
Configure Nginx as the reverse proxy
Disable direct public access to port 3000 and create an Nginx server block for your hostname. The following configuration handles normal HTTP proxying and WebSocket upgrades:
server {
listen 80;
listen [::]:80;
server_name app.example.com;
location / {
proxy_pass http://127.0.0.1:3000;
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";
proxy_read_timeout 60s;
}
}
Replace the example hostname with the real DNS name. Test and enable the site:
sudo nginx -t
sudo ln -s /etc/nginx/sites-available/next-app /etc/nginx/sites-enabled/next-app
sudo systemctl reload nginx
On distributions without the Debian-style sites directories, include the server block from the distribution’s main Nginx configuration. Keep the default site disabled if it would answer for the same address.
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 reinstallPreserve streaming responses
Streaming and Suspense responses require every proxy hop to pass chunks instead of waiting for the complete response. If your application streams, disable buffering for the affected location or have the response include X-Accel-Buffering: no. Verify that Nginx and any additional load balancer preserve chunked or HTTP/2 streaming. Disabling buffering globally can increase connection and memory usage, so scope it to routes that need streaming.
Add HTTPS and redirect HTTP
After DNS resolves and Nginx serves the hostname, obtain a certificate with your distribution’s ACME client. A common Debian-based setup is:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d app.example.com
Review the generated configuration, enable automatic renewal, and test renewal in the client’s dry-run mode. The certificate client normally adds an HTTP-to-HTTPS redirect; if it does not, configure a separate port-80 server block that returns a permanent redirect to the HTTPS URL.
Best Value
Continue allowing ports 80 and 443 for certificate validation and web traffic, but do not open 3000. Confirm that the certificate covers every hostname users will visit.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Verify the finished deployment
Check each layer rather than relying on a browser page alone.
- DNS: Resolve the hostname from an external network and confirm it returns the VPS address.
- Local app: Run
curl -I http://127.0.0.1:3000on the server. - Supervisor: Restart through PM2 or systemd and confirm the process returns without manual intervention.
- Proxy: Request the public HTTPS URL and inspect the response status and headers.
- Static assets: Open JavaScript, CSS, and font files from a production page; a missing asset often indicates an incorrect base path or proxy rule.
- Images: Test both ordinary images and
next/imageoptimization. Check logs and memory while optimizing larger images. - Environment: Exercise a server-side feature that uses a secret, and verify that no secret appears in rendered HTML, browser JavaScript, or logs.
- Error handling: Visit a nonexistent route and trigger a controlled server error to confirm your error pages and Nginx logging work.
- Reboot: Reboot during a maintenance window and verify that Nginx and the chosen process supervisor start automatically.
Common failures and their fixes
| Symptom | Likely cause | What to check or change |
|---|---|---|
502 Bad Gateway from Nginx |
Next.js is stopped, listening on another port, or bound to an unexpected address. | Inspect PM2 or systemctl status next-app, review logs, and compare the listener with ss -ltnp. Ensure proxy_pass uses the same local port. |
| Build fails on the VPS | Unsupported Node.js version, missing lockfile dependencies, insufficient disk, or absent environment variables required at build time. | Compare the runtime with the project’s requirements, run the correct frozen-lockfile install, check disk space, and provide required build-time variables. |
| Public environment value is stale | A NEXT_PUBLIC_ value was changed after the last build. |
Update the value and run npm run build again before restarting. |
| Secret is visible in the browser | The value was prefixed for public exposure or imported into client code. | Move it to a server-only variable and keep the code path on the server. Rotate the exposed credential. |
| Images cause high memory use | Self-hosted image optimization is processing large or numerous files. | Monitor the process on your glibc-based Linux system, constrain source image dimensions and formats, and apply the image-optimization configuration recommended for your Next.js release. |
| Streaming arrives all at once | Nginx or another intermediary is buffering the response. | Disable buffering for streaming routes, use X-Accel-Buffering: no where appropriate, and test every proxy hop. |
| Changes do not appear after deployment | Old process, stale build output, or cache. | Build from the new revision, restart the supervisor, inspect the running revision, and invalidate any application or proxy cache deliberately. |
| Application works locally but not after a reboot | The supervisor was not enabled, uses the wrong Node/npm path, or cannot read the environment file. | Check the boot unit, absolute executable paths, file ownership, and startup logs. |
Deploy updates and recover safely
Keep releases repeatable. A basic update sequence is:
- Put the new revision in a separate release directory or update the working tree during a maintenance window.
- Install dependencies with the lockfile’s frozen mode.
- Set and verify build-time variables.
- Run
npm run buildand stop if it fails. - Switch the process to the new release and restart PM2 or systemd.
- Run the verification checks against the public hostname.
For quick rollback, retain the previous known-good build and environment, then point the supervisor back to that release and restart it. Back up the database and any user-uploaded files separately; a VPS snapshot alone may not provide the recovery granularity your application needs.
Plan for cache, files, and more than one instance
A single VPS process can use local disk and in-process memory, but those assumptions break when you add a second instance or replace the server. Shared cache coordination, session storage, uploaded files, and background jobs need durable or network-accessible services. Do not assume that a cache created by one Next.js process is visible to another.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →If you scale horizontally, place the instances behind a load balancer, keep them on the same compatible build, and decide where durable state lives before enabling traffic to the additional instance. Continue terminating TLS and applying request controls at the proxy or load-balancer layer.
Security and maintenance checklist
- Use a non-root deployment account and SSH keys.
- Apply operating-system and Node.js security updates on a planned schedule.
- Allow only SSH, HTTP, and HTTPS through the firewall; keep the Next.js port private.
- Store secrets outside source control with restrictive permissions.
- Review Nginx access and error logs, PM2 logs or the systemd journal, and disk usage.
- Configure log rotation and alerting for repeated crashes or certificate-renewal failures.
- Back up databases, uploads, and configuration, and periodically test restoration.
- Renew TLS certificates automatically and verify renewal before expiry.
- Rebuild whenever public environment variables or application code changes.
- Test image optimization and streaming after major Next.js or Nginx upgrades.
Can you deploy Next.js without a managed platform?
Yes. A Linux VPS can run the complete Next.js Node.js server without a managed platform. You are responsible for operating-system updates, process supervision, Nginx configuration, TLS, backups, monitoring, and scaling decisions. That additional control is the reason to choose a VPS; it is also the maintenance work that a fully managed deployment hides.
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.




