Free tools Windows power users keep installed
One-click scans. No signup required.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
Run your Discord bot under PM2, then pair pm2 startup with pm2 save. PM2 will restart the Node.js process when it exits unexpectedly and restore the saved process after a VPS reboot, so closing SSH does not stop the bot.
The essential sequence is:
npm install --global pm2
pm2 start index.js --name discord-bot
pm2 startup
pm2 save
Replace index.js with your bot’s actual entry file. The pm2 startup command prints a second command tailored to your VPS; copy and run that command exactly, usually with root privileges, before running pm2 save.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →What PM2 changes for a Discord bot
Starting a bot with node index.js attaches it to the current shell. When that SSH session closes, the process can receive a hang-up signal or simply be left without a supervisor. A process that crashes also stays down unless something starts it again.
PM2 is a process supervisor for Node.js. Its default autorestart behavior respawns an application that exits unexpectedly. It also provides a process list, logs, and a local monitoring view. PM2 describes the result as keeping an application alive across crashes and machine restarts, but the reboot portion requires an additional boot integration step.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
There are two separate mechanisms:
- Crash supervision: PM2 notices that the bot process exited and starts it again.
- Boot persistence: the init-system integration created by
pm2 startupruns PM2 during boot, while the list saved bypm2 savetells PM2 which applications to resurrect.
Using only one of these mechanisms leaves a gap. A saved list without startup integration is not launched after a reboot, and startup integration without a current saved list has no correctly defined application set to restore.
Prerequisites and account choice
You need SSH access to a VPS, Node.js and npm installed, and a Discord bot project that can run from a directory on that server. Identify the entry file your project actually uses; common names include index.js, bot.js, or a compiled file under a dist directory.
Recommended Free Tools
Choose one deployment account and use it consistently. PM2’s process list and dump belong to the Unix user who ran PM2. Installing or starting the bot as one account and configuring startup as another commonly produces a service that boots without the expected application.
Before starting the process, make sure dependencies are installed in the project directory, for example with the package manager and lockfile your project uses. PM2 does not install missing bot dependencies; it only supervises the command you give it.
Install PM2 and start the bot
- Connect and enter the project directory.
ssh your-user@your-vps cd /path/to/your/discord-botUse the directory that contains the entry file and the project’s
node_modules, or use an absolute script path later. - Install PM2 globally.
npm install --global pm2A global install makes the
pm2command available to the deployment account. If your server uses a version manager, install it while the intended Node.js version is active. - Start the entry file with a stable process name.
pm2 start index.js --name discord-botReplace
index.jswith the real entry file. The name is an operator label used by commands such aspm2 logs discord-botandpm2 restart discord-bot. - Check that PM2 accepted the process.
pm2 statusThe list should show
discord-botwith an online status. If it is stopped or repeatedly restarting, inspect logs before proceeding to boot configuration.
PM2 starts the process from the shell’s current working directory unless you configure another working directory. Starting from the project directory is therefore the least surprising approach when the bot loads relative files such as configuration, commands, or certificates.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
Read logs and monitor the running process
Use the named log stream first:
pm2 logs discord-bot
This follows the bot’s standard output and error output. Stop following the stream with Ctrl+C; that leaves the managed process running. For a dashboard-style local view, run:
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 →pm2 monit
PM2 documents pm2 monit as local process monitoring. It is useful for spotting restart loops and resource growth, while pm2 status is the quick check for whether the process is online.
A successful Discord login message confirms that the application reached Discord, not merely that Node.js started. Also check for configuration errors, missing intents, rejected tokens, and unhandled exceptions in the log output.
Enable automatic startup after a VPS reboot
- Ask PM2 to generate boot integration.
pm2 startupPM2 detects the VPS init system and prints a follow-up command. That command can include a service type, user, home directory, and an environment path.
- Run the printed command exactly.Copy the complete command from PM2’s output and execute it as instructed, normally with root privileges. Do not replace it with a generic command: the generated path must point to the Node.js and PM2 installation used by the deployment account.
- Save the current process list.
pm2 saveThis writes PM2’s dump for the current user. At boot, the startup service launches PM2, and PM2 resurrects the applications in that dump.
- Confirm the saved state.
pm2 status pm2 logs discord-botVerify the bot is online and that its logs show a normal connection rather than an immediate crash.
pm2 save alone does not install a boot-time init hook. Conversely, pm2 startup does not automatically save every process you might start later; run pm2 save whenever the desired process list changes.
Test the setup instead of assuming it works
A reboot test is the operational check that catches incorrect users, paths, and missing environment variables. Schedule it when a short interruption is acceptable because the VPS will be unavailable during the reboot.
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 glitchesRank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
- Record the expected process name with
pm2 statusand make sure the bot is healthy before rebooting. - Reboot through your VPS provider’s console or from SSH with the command appropriate to your operating system.
- Reconnect after the server returns.
- Run
pm2 status. The bot should be present without a manualpm2 start. - Run
pm2 logs discord-botand confirm a fresh startup and Discord connection.
If the process is absent after reboot, first check that startup integration was actually installed and that the process list was saved by the same user. If the process appears but exits, treat it as an application or environment problem rather than a PM2 boot problem.
Understand the different kinds of restart
Automatic crash restart
With the default autorestart behavior, PM2 respawns a process that terminates unexpectedly. This covers many uncaught exceptions and native exits, but it cannot fix a logical failure in which the Node.js process remains alive while the bot has lost its Discord connection. Your application still needs appropriate connection handling and error reporting.
Manual restart
pm2 restart discord-bot
A manual restart stops and starts the process. PM2 notes that this makes the service briefly unavailable, so use it during a maintenance window when a short disconnect matters.
Reboot restoration
Restoration after a machine restart is not the same event as crash supervision. It depends on the init hook from pm2 startup and the process dump produced by pm2 save.
Windows 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 reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchUse an ecosystem file for repeated crashes and resource limits
The one-line pm2 start command is adequate for a simple bot. An ecosystem file makes restart policy and environment selection explicit when the bot needs tuning.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
module.exports = {
apps: [{
name: 'discord-bot',
script: './index.js',
restart_delay: 4000,
max_restarts: 16,
max_memory_restart: '300M',
env: { NODE_ENV: 'production' }
}]
};
Save this as ecosystem.config.js in the project directory, then start it with:
pm2 start ecosystem.config.js --env production
pm2 save
Run pm2 save again after changing the ecosystem configuration so the boot-time dump contains the new settings.
| Setting | What it controls | How to choose it |
|---|---|---|
restart_delay |
Wait time between restarts, in milliseconds. | Use a delay when the bot or a dependency needs time to recover, or when immediate retries would overload a service. |
max_restarts |
Limits repeated restart attempts. | Set a value that exposes a persistent failure instead of allowing an endless rapid loop. |
max_memory_restart |
Restarts the process when it exceeds a memory threshold. | Base the threshold on the VPS’s available memory and the bot’s normal usage; 300M is only an example. |
autorestart |
Enables or disables automatic respawning. | Leave it enabled for a continuously running bot unless you have a deliberate maintenance reason to disable it. |
| Exponential backoff | Increases the wait between repeated crashes. | Prefer it when a failing dependency would make fixed, short retries noisy or expensive. |
env and named environments |
Provides environment variables and selects an environment such as production. | Keep runtime configuration separate from code and invoke the intended environment explicitly. |
These controls are policy knobs, not universal values. A small hobby bot and a memory-intensive production bot should not share the same restart limits without measuring their behavior.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Keep the Discord token out of the ecosystem file
The bot token grants control of the Discord application. Do not commit it to a public repository or place it in an ecosystem file that other users can read. The example file contains only NODE_ENV for that reason.
Provide the token through the environment or another secret mechanism already approved for your server, and have the bot read it at runtime. Check file permissions and shell history as well: putting a secret directly in a command can leave it visible to other operators or in recorded history.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
After changing a token or another environment value, restart the process and save the updated process definition if the value is part of the PM2-managed environment:
pm2 restart discord-bot --update-env
pm2 save
Only use --update-env when you intentionally want PM2 to refresh environment values from the current definition.
Common failure modes and fixes
| Symptom | Likely cause | What to check |
|---|---|---|
| Bot stops when SSH closes | It was started directly with Node.js or under a shell-only session. | Start it with pm2 start and verify it appears in pm2 status. |
| Bot runs now but not after reboot | Startup integration was skipped, or the process list was never saved. | Run pm2 startup, execute its printed command, then run pm2 save as the deployment user. |
pm2 save seems to have no effect |
The save belongs to a different Unix account than the startup service. | Check which user owns the PM2 process and repeat setup with that account. For another account, PM2’s startup command supports -u and --hp. |
| Process shows “errored” or restarts repeatedly | Application exception, missing dependency, invalid working directory, or bad configuration. | Read pm2 logs discord-bot, run the entry file manually from the project directory, and correct the first fatal error. |
| Bot starts but cannot log in | Token or required environment variables are absent in the PM2 context. | Confirm the runtime environment used by PM2 contains the same variables as your interactive shell, without exposing the token. |
| Bot dies after a Node.js upgrade | The generated startup service still points to the old Node.js or PM2 path. | Regenerate startup integration with pm2 startup, run the newly printed command, and save the process list again. |
| Bot is online but unresponsive | The process has not crashed; the Discord connection or application logic is unhealthy. | Inspect application logs and connection handling. PM2 can restart an exited process, but it cannot diagnose a live process that has stopped doing useful work. |
Node.js version-manager upgrades require startup maintenance
When Node.js is installed through NVM or another per-user version manager, its executable path can change during an upgrade. The boot service generated earlier may still reference the old path. After upgrading Node.js, repeat the startup setup:
- Activate the new Node.js version for the deployment account.
- Confirm
node --versionandpm2 --versionresolve to the intended installations. - Run
pm2 startupand execute the exact command it prints. - Run
pm2 saveto refresh the saved process definition. - Check logs and perform a planned reboot test if the service is business-critical.
Operate the bot safely day to day
Use the process name consistently so routine actions are unambiguous:
pm2 status— list managed processes and their current state.pm2 logs discord-bot— follow this bot’s output and errors.pm2 monit— view local process and resource monitoring.pm2 restart discord-bot— perform a deliberate restart with a short interruption.pm2 save— persist a changed process list or ecosystem configuration for the next boot.
When removing a bot from PM2, stop and delete the process intentionally, then save again if you do not want it resurrected at the next boot. Keeping obsolete entries in the dump can cause confusion during incident response.
What PM2 can and cannot guarantee
PM2 is appropriate when the requirement is “keep this Node.js process running and bring it back after a crash or reboot.” It does not make a broken bot correct, renew an expired Discord token, repair a failed network route, or replace application-level health checks. A process that repeatedly crashes should be investigated rather than hidden behind unlimited retries.
For a reliable deployment, combine PM2 supervision with bounded restart behavior, protected secrets, readable logs, and a tested boot procedure. The decisive configuration is simple: start the correct entry file under the intended user, install the generated startup hook, and save the process list after every meaningful change.
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.

