What You Can Run on a Node.js Server (Discord Bots, APIs, Web Apps)

Node.js is a single-threaded, event-driven JavaScript runtime built on V8. It is excellent at handling many concurrent connections with low memory overhead, which makes it a good fit for a wide range of hosted workloads:

  • Discord bots - using discord.js, Eris, Sapphire, or similar libraries. These are long-running gateway connections, not web servers.
  • REST APIs - using Express, Fastify, or Hono. A simple API server can serve hundreds of requests per second on minimal hardware.
  • WebSocket servers - for real-time features in games, chat apps, or collaborative tools.
  • Scheduled tasks and automation - cron-style scripts using node-cron or similar, running continuously in the background.
  • Telegram, Twitch, or other platform bots - any persistent connection-based application works the same way as a Discord bot.

All of these share the same fundamental requirement: a server that keeps the Node.js process alive indefinitely, restarts it on crash, and does not impose artificial sleep or rate limits.

Free Hosting Options (Railway Free Tier, Render Free, NetSkyway)

The free hosting landscape for Node.js apps has changed significantly over the past few years. Here is where things stand:

Railway has a free tier with a monthly usage limit (around $5 of compute credit). For a lightweight Discord bot that uses minimal CPU, this may last the whole month. But once you hit the limit, the service shuts down until the next billing period. Railway is good for development and testing but unreliable for production bots that need guaranteed uptime.

Render offers free web services that spin down after 15 minutes of inactivity. This is fine for a web server that gets regular traffic, but it is a problem for Discord bots that have long gaps between interactions. The 30-second cold start after a spin-down means bot commands may time out. Render also introduced credit limits that make the "free" tier increasingly restricted.

NetSkyway offers dedicated server slots for free, including Node.js environments. The process does not get spun down on inactivity the same way cloud platforms do. You get a persistent slot on real hardware where your app runs continuously for as long as you need it.

Getting a NetSkyway Slot for Node.js

To request a Node.js slot on NetSkyway, join the Discord server at discord.gg/QXKNwaWVJ2 and follow the instructions in the request channel. Slots are approved manually. Once approved, you will receive panel credentials.

In the panel, you can see your server's CPU and memory usage, view live console output, restart the process, and access file management. The panel is built on Pterodactyl, which provides a clean browser-based interface for everything you need without requiring SSH access.

SFTP credentials are shown in the panel's SFTP section. Use FileZilla or WinSCP to upload your project files. The SFTP port is 2022. Your username and password are your panel account credentials.

The hardware is not virtualized shared hosting. NetSkyway runs on i9-13900K and Ryzen 9 9950X machines with DDR5 RAM and NVMe storage. This matters for apps that are CPU-bound or do a lot of file I/O.

Deploying Your App (git clone or SFTP Upload)

There are two clean ways to get your code onto the server:

SFTP upload: Use FileZilla to drag your project folder to the server root. This works well for projects that do not have a git repository or where you want to transfer files directly. Remember to exclude node_modules from the upload since you will run npm install on the server.

git clone via console: Open the console in the panel and run:

git clone https://github.com/yourname/yourbot.git .
npm install

Using git makes future updates cleaner. To update your running app, pull the latest changes and restart the process:

git pull
pm2 restart myapp

If your project uses environment variables (bot tokens, API keys), create a .env file in the server root after uploading. Never commit tokens to git. The panel's file editor lets you create and edit files directly in the browser without going through SFTP.

Process Management with PM2

PM2 is the standard process manager for Node.js production deployments. Install it once:

npm install -g pm2

Start your application:

pm2 start app.js --name "myapp"

Useful PM2 commands:

  • pm2 list - see all running processes and their status
  • pm2 logs myapp - stream live logs
  • pm2 restart myapp - restart after a code update
  • pm2 stop myapp - stop the process without removing it
  • pm2 delete myapp - remove a process from PM2's list

PM2 automatically restarts your app if it crashes. It also supports clustering (running multiple instances across CPU cores), which is useful for high-traffic Express APIs. For most Discord bots, a single instance is more than enough.

Keeping It Online After Logout (pm2 startup)

PM2's process list is in-memory by default. If the server restarts, PM2 starts fresh and your app is not running. To fix this, save the current process list and configure PM2 to restore it on boot:

pm2 save
pm2 startup

The pm2 startup command generates a system-specific command that you need to run once with elevated privileges. It creates a startup script so PM2 launches automatically on system boot and restores your saved process list.

After running pm2 startup and the generated command, test it by restarting the server from the panel (using the Power tab) and confirming your process comes back up automatically with pm2 list.

With startup configured, your Node.js app runs fully autonomously. No manual intervention needed after deployment. Updates are a pull-and-restart away, and crashes are handled by PM2 without any action on your part.