DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk9 min

Essential Linux Commands for Managing Your VPS

The essential Linux commands for connecting to, updating, monitoring, troubleshooting and securing an Ubuntu or Debian-based VPS, with safe execution order and recovery advice.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Most VPS administration tasks reduce to a small, dependable command set. Connect with ssh, update the operating system with apt, inspect disk, memory, processes and listening ports, control services with systemctl, read logs with journalctl, and establish a firewall before exposing more software. The examples below target Ubuntu and other Debian-based images; RHEL-family systems use dnf and usually firewalld instead of apt and ufw.

Connect safely and perform the first update

Your provider normally gives you an IP address, a username and either a password or an SSH key. From your local terminal, connect with:

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ssh user@your_vps_ip

Replace user and your_vps_ip with the account and address supplied for the server. Once logged in, run the package-index refresh and install available upgrades:

sudo apt update && sudo apt upgrade -y

apt update downloads current package metadata; apt upgrade installs available upgrades. The command is suitable for a fresh Ubuntu or Debian-based image, but read any prompts that appear on an established production server. A kernel or library update can require a reboot or a service restart, so schedule this work when a brief interruption is acceptable.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [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.

Confirm which system you are administering

Before copying commands from an Ubuntu guide, check the distribution documentation and the local manual pages. The command groups in this article are Ubuntu/Debian-leaning. A RHEL-family VPS normally uses dnf for packages and firewalld for firewall administration, so substituting commands without checking can fail or leave the host unprotected.

Disk-space checks that find the real problem

Start with a filesystem-level view:

df -h

The -h option makes sizes readable. Watch the row mounted at /, because a full root filesystem can prevent package updates, log writes and service startup. If the server has separate mounts, inspect those rows as well.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After identifying a full mount, find which directories consume it:

du -sh /path/to/directory/*

du -sh summarizes directory sizes. Run it on likely locations such as application data, backups or logs, and narrow the path rather than scanning the entire filesystem blindly. Do not delete files simply because they are large: verify that they are disposable, that no process still needs them and that a retention policy does not require them.

When disk usage rises unexpectedly

  • Run df -h first to distinguish a full filesystem from a full directory on another mount.
  • Use du -sh to locate the largest top-level directories, then repeat at the next level.
  • Check service logs before removing anything; a repeated error can refill the disk after cleanup.
  • After cleanup or rotation, run df -h again to confirm that space was actually returned.

Check memory, CPU and running processes

Memory snapshot

free -h

This displays total, used and available memory in human-readable units. Treat the available-memory figure and swap activity as operational signals rather than judging health from the used column alone. If an application is being killed or the system is swapping heavily, inspect its processes and logs before adding RAM or changing limits.

Interactive CPU and process view

top

top continuously refreshes CPU and memory statistics and lists active processes. Inside top, press k, enter the process ID and confirm only when you are certain the process is safe to stop. Killing a database, SSH daemon or web service can cause an outage or data loss.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【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.

Scriptable process listing

ps aux

ps aux gives a point-in-time process list that is easier to capture in a ticket or script than an interactive display. Use it to identify a process ID, owner and command line, then investigate why the process is consuming resources before terminating it.

See which ports are listening

ss -tulpn

This lists listening TCP and UDP sockets together with the owning process where the system permits that information. Compare the result with the services you intended to expose. An unexpected listener deserves investigation; a service bound only to localhost is different from one listening on every network interface.

A practical exposure check

  1. Run ss -tulpn immediately after installing a service.
  2. Identify the process associated with each listening port.
  3. Confirm that the service needs external access, or bind it to a private interface when it does not.
  4. Create firewall rules only for ports that clients genuinely require.

Control services with systemd

Ubuntu services are commonly managed by systemd. Replace <service> with the unit name, such as a web server or database service.

Command Use
systemctl status <service> Show whether the service is running and display recent status information.
sudo systemctl restart <service> Stop and start the service, applying its current configuration.
sudo systemctl reload <service> Ask a service to reread configuration without a full stop/start when that unit supports reload.
sudo systemctl enable <service> Configure the service to start during boot.

Use status before restarting so you capture the current error message and recent state. A restart is not a substitute for configuration validation: if a configuration file is invalid, the service may remain down. Reload is gentler but is not implemented by every unit; consult the service’s documentation or systemctl status output.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read logs when a service fails

systemd’s journal is the first place to look after a failed start, crash or unexpected shutdown.

sudo journalctl -xe

This presents recent entries with additional context for troubleshooting. To follow one unit as new records arrive:

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [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
sudo journalctl -u nginx -f

Replace nginx with the relevant unit. For SSH on Ubuntu, the commonly used form is:

sudo journalctl -fu ssh.service

Use the log timestamp and process name to correlate an error with the deployment, package update or configuration change that preceded it. Avoid pasting private keys, tokens or user data from logs into public forums.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A repeatable service-recovery sequence

  1. Run systemctl status <service> and note the unit state and latest error.
  2. Run sudo journalctl -u <service> -f in one terminal.
  3. In another session, reproduce the start, reload or request that fails.
  4. Correct the stated configuration, permission or dependency issue.
  5. Restart or reload the unit, then verify its status and listening sockets with ss -tulpn.

Set up the firewall without locking yourself out

On Ubuntu, UFW is disabled by default. The safe order on a remote VPS is to allow SSH first and enable the firewall second:

sudo ufw allow OpenSSH
sudo ufw enable

Enabling UFW before an SSH rule can block your current remote connection. Keep the existing SSH session open while testing a second connection, so a mistaken rule does not leave you without access.

Firewall checklist

  • Allow the SSH service before enabling UFW.
  • Add rules for only the web, API or administration ports your workload needs.
  • After changing rules, test from a separate terminal or network.
  • Keep a provider console or out-of-band recovery path available for emergencies.

For a RHEL-family system, use its documented firewalld workflow instead of UFW commands. Firewall syntax and service names vary by distribution, so consult the local man pages before applying a copied rule.

Harden SSH and file permissions

Ubuntu’s OpenSSH configuration includes drop-in files from /etc/ssh/sshd_config.d/*.conf. Those drop-ins are read near the top, and OpenSSH uses the first value set for a configuration keyword. A drop-in can therefore take precedence over a later value in the main file. Make one deliberate change at a time, validate it, and keep an existing session open until a new login succeeds.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • 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.

Private key files should not be readable by other users. A commonly used example is:

chmod 600 /path/to/private_key

Apply permissions to the actual key path and verify the owner as well. Because permission requirements differ by program and distribution, check the relevant manual page before changing a production file.

Fail2ban as a second layer

Fail2ban watches authentication logs and can block an IP address after repeated failed logins. It complements, rather than replaces, strong SSH keys, least-privilege accounts and a correctly configured firewall. Review its jail configuration and make sure your own administrative address cannot be blocked accidentally.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep security updates automatic

Ubuntu has included unattended-upgrades by default since Ubuntu 18.04 LTS. It applies security updates daily through scheduled systemd timers. Configuration is split across:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • /etc/apt/apt.conf.d/50unattended-upgrades for update policy.
  • /etc/apt/apt.conf.d/20auto-upgrades for periodic-update settings.
  • /var/log/unattended-upgrades for its logs.

Change drop-in files rather than editing a distribution-maintained main configuration file. To toggle unattended-upgrades interactively, run:

sudo dpkg-reconfigure unattended-upgrades

The apt-daily.timer and apt-daily-upgrade.timer schedule these jobs with a random delay. If scheduling conflicts with maintenance windows, inspect the timer units and use:

sudo systemctl edit <timer>

For example, edit the relevant daily timer and set Persistent=false only when you understand the effect of missed runs. Library upgrades can trigger needrestart, which may restart affected services. Monitor the unattended-upgrades log and your service health after major updates.

Keep long-running administration sessions alive

A network drop can terminate a normal SSH shell and any foreground command running inside it. tmux keeps a terminal session on the server so you can reconnect after disconnecting. Start a session before a long migration, upgrade or log-following task, then detach and reattach when needed. It does not make a command safe by itself: still use backups, locking and an explicit rollback plan for changes that can alter data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Schedule recurring work with cron

Edit a user’s crontab with:

crontab -e

List that user’s existing entries with:

crontab -l

Use cron for narrowly defined recurring jobs such as maintenance scripts, but verify the schedule syntax and environment in the local crontab manual before deploying. Cron runs with a limited environment, so use absolute paths, write useful logs and ensure the job is idempotent. For tasks that need dependency handling, missed-run behavior or centralized logging, a systemd timer may be more appropriate.

A compact first-day runbook

  1. Connect with ssh user@your_vps_ip.
  2. Run sudo apt update && sudo apt upgrade -y.
  3. Check storage with df -h and investigate large directories with du -sh.
  4. Check memory and processes using free -h, top and ps aux.
  5. Inspect listening ports with ss -tulpn.
  6. Review enabled services with systemctl status <service> and read relevant journal entries.
  7. Allow SSH with sudo ufw allow OpenSSH, then enable UFW.
  8. Confirm unattended-upgrades settings and review /var/log/unattended-upgrades.
  9. Run long changes inside tmux and record any cron jobs with crontab -l.

Common mistakes and recovery paths

SSH stops working after a firewall change

Do not close every existing session. Use the provider’s console or recovery access, add the OpenSSH rule, then test a fresh login before ending the original session.

A service will not restart

Read systemctl status and journalctl -u <service> output first. Correct the named configuration, permission or dependency problem; repeated restarts without reading the error can hide the cause.

The disk is full but deleting a directory changes nothing

Recheck df -h, identify the mount that is full and use du -sh within that mount. A deleted file held open by a running process may not release space until the process closes it, so inspect the owning service and its logs before restarting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Automatic updates appear to run at inconvenient times

Inspect apt-daily.timer and apt-daily-upgrade.timer, including their randomized delay. Adjust a timer through systemctl edit only after deciding how missed runs and service restarts should be handled.

Command reference

Task Command What to check
Remote login ssh user@your_vps_ip Correct account, address and key or password.
Package update sudo apt update && sudo apt upgrade -y Prompts, reboots and service-impacting upgrades.
Disk capacity df -h The row mounted at / and any separate mounts.
Directory size du -sh /path/to/directory/* Large data, backup and log directories.
Memory free -h Available memory and swap pressure.
Processes top or ps aux CPU, memory, process ID and owner.
Listening ports ss -tulpn Unexpected listeners and interface bindings.
Service state systemctl status <service> Unit state and recent errors.
Follow service logs sudo journalctl -u <service> -f Errors while reproducing the failure.
Firewall sudo ufw allow OpenSSH
sudo ufw enable
SSH access before activation.
Automatic updates sudo dpkg-reconfigure unattended-upgrades Policy files, timer behavior and update logs.
Persistent shell tmux Reattach after network interruptions.
User cron crontab -e
crontab -l
Verified schedule, absolute paths and logging.

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.

Leave a Reply

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

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.