Linux VPS: Essential Commands to Get Started
You have just received a BoxToPlay Linux VPS and a public IP address, but you have never used Linux before. Where do you type commands? How do you create folders, edit a configuration file, upload an archive from Windows, install a tool, or keep an application running after you close the terminal?
This BoxToPlay guide starts from zero. Its purpose is not to teach every part of Linux. It gives you the practical foundations required to host a website, a bot, a game service, an API, a database, or another application on a Debian or Ubuntu VPS.
Every command is explained before you move to the next task. Whenever Linux has a useful Windows equivalent, a Windows reference point helps you connect the new idea to something familiar.
Important: examples use the documentation-only IP address
203.0.113.10, the accountroot, and the folder/opt/my-service. Replace them with your own values. Never paste an unknown command with administrator privileges without understanding it.
Code blocks marked bash are typed in the VPS SSH terminal, so inside PuTTY, Termix, or another SSH client that is already connected. Code blocks marked powershell are typed on your Windows PC.
If you are starting from zero, follow this order:
- Open an SSH connection from Windows.
- Check the connected account and Linux version.
- Update the system.
- Understand
root,sudo, and optional user creation. - Learn how to navigate, copy, and edit files.
- Install useful tools.
- Run your application as a service, then check logs, firewall rules, and backups.
What changes between a Windows PC and a Linux VPS?
A Windows computer is usually managed through windows, menus, File Explorer, Task Manager, and graphical installers. A Linux server is commonly administered remotely through a terminal. The screen is different, but most concepts have a direct equivalent.
| Familiar action on Windows | Usual Linux server equivalent |
|---|---|
| Windows Terminal or PowerShell | A local terminal used to start an SSH connection |
| Remote Desktop | SSH, a secure text connection |
| File Explorer | ls, cd, cp, mv, rm, or an SFTP client such as WinSCP |
| Notepad | nano in the terminal |
| Windows Update | apt update followed by apt upgrade |
| WinGet or an installer | apt install package-name |
| Run as administrator and UAC | sudo |
| Task Manager | htop, ps, free, and df |
| Windows Services | systemd and systemctl |
| Event Viewer | journalctl |
| Windows Defender Firewall | ufw, nftables, or iptables |
| 7-Zip or Extract All | unzip, tar, gzip, and xz |
| Copying files over the network | SFTP, SCP, or rsync |
Linux file and command names are usually case-sensitive. Config, config, and CONFIG can therefore be three different names.
Choose your tools on Windows
You only need a few programs to begin. What matters is having two capabilities: opening the VPS SSH terminal and transferring files over SFTP. Termix groups both in one application. PuTTY with WinSCP remains the classic pair if you prefer to separate terminal access and file management.
PuTTY: a classic graphical SSH client
PuTTY provides a connection window, saved sessions, and companion tools such as PuTTYgen for SSH keys and PSCP for file transfers.
It remains useful when you prefer a dedicated graphical application. Do not install several SSH clients just because they are listed here: choose the one you understand best.
WinSCP: a File Explorer-like view of the VPS
WinSCP displays the local Windows files on one side and the VPS files on the other. It uses SFTP over the same secure connection as SSH.
WinSCP is especially helpful if you chose PuTTY for the terminal and want a separate tool for uploads, downloads, backups, or small file edits.
Termix: SSH and files in one interface
Termix combines SSH terminal access, SFTP-compatible remote file management, tunnels, statistics, and server organization.
Termix is therefore the simplest default recommendation if you want one place for the terminal, file transfers, and saved connections. PuTTY with WinSCP remains a classic alternative if you prefer two separate, well-known, lightweight tools.
Before starting: how to read a Linux command
A command normally contains three kinds of elements:
command option argument
- The command is the program to run, such as
ls. - An option changes its behavior. It often begins with
-or--, such as-hor--help. - An argument identifies what the command should use, such as the path
/opt/my-service.
Consider this example:
ls -lah /opt
lslists files and folders.-lrequests a detailed list.-aincludes hidden entries whose names begin with a dot.-hdisplays sizes in readable units such as KB, MB, or GB./optis the folder being inspected.
Several symbols appear often:
~represents the current user’s personal folder, such as/root..represents the current folder...represents the parent folder./is the root of the entire Linux file system, not a drive letter.$USERis a variable containing the current account name.*is a wildcard representing several matching names.|sends the output of one command into another command.Ctrl+Cinterrupts a command that is currently running.
Windows reference point: a PowerShell command such as
Get-ChildItem -Force C:\Tempfollows the same basic idea: command, option, and target.
To see the built-in manual for a command:
man ls
manopens a manual page.lsis the command whose documentation you want.- Use the arrow keys to move,
/to search, andqto quit.
If a command supports it, a shorter help page is often available:
ls --help
--helpaskslsto print its options without opening the full manual.
Connect to the VPS with your SSH client
After your BoxToPlay VPS is delivered, your control panel normally shows:
- the public IP address.
- an SSH port, usually
22. - the initial SSH user
root. - either a password or an SSH private key.
Open the SSH client you chose, for example PuTTY or Termix, and create a new connection. Fill in:
- Host:
203.0.113.10. - Port:
22or the SSH port shown in your BoxToPlay control panel. - Protocol:
SSH. - User name:
root. - Authentication: the initial password or the private key.
The root account is the Linux superuser. On a BoxToPlay VPS, it is the normal first administration account. It can change the whole system, so read commands before pasting them.
In PuTTY, enter the address in Host Name, check the Port, keep the connection type set to SSH, then save the session if you want to reuse it later.
In Termix, create a server or connection, then enter the host, port, user name, and authentication method.
In WinSCP, choose SFTP, enter the same details, then connect to manage files. WinSCP does not replace a full terminal: keep PuTTY or Termix available for administration commands.
The first connection displays the server fingerprint. Compare it with the value shown by BoxToPlay when one is available, then accept it only if the destination is correct. This fingerprint helps detect a server impersonation.
When a password is requested, no character appears while you type. This is normal: Linux does not display dots or asterisks for terminal passwords.
Windows reference point: SSH serves a purpose similar to Remote Desktop, but it opens a command-line session instead of a graphical desktop.
Identify the system before changing it
Once connected, run:
whoami
hostname
cat /etc/os-release
uname -r
whoamiprints the connected account name. The same command also exists on Windows.hostnameprints the machine name. It also exists on Windows.catprints a text file./etc/os-releasedescribes the Linux distribution and its version.uname -rprints the Linux kernel version. The kernel is the central part of the operating system.
On a fresh Ubuntu 24.04 VPS, the output looked like this:
root
vps-demo
PRETTY_NAME="Ubuntu 24.04.4 LTS"
6.8.0-136-generic
The first line confirms the account being used. The second line is the machine name. The last two lines identify the Linux distribution and kernel.
Windows reference point:
cat /etc/os-releaseanduname -rprovide information similar to PowerShellGet-ComputerInfoor thewinverwindow.
Understand sudo, apt, and apt-get
Debian and Ubuntu distribute software as packages. A package contains a program, its version, and the information required to install it. Packages come from repositories, which are software catalogs configured on the server.
apt is the package manager intended for interactive terminal use. It can search, install, update, and remove software.
You will also encounter apt-get, with a hyphen. Both tools use the same repositories and install the same packages:
apthas friendlier output for a person using a terminal.apt-gethas stable output and behavior that is commonly preferred in automation scripts.
With apt |
Common older syntax with apt-get |
Result |
|---|---|---|
apt update |
apt-get update |
Refresh the package catalog |
apt install htop |
apt-get install htop |
Install the htop package |
This guide uses apt. You do not need to repeat the same action with apt-get.
sudo means “run the next command with administrator privileges.” It is comparable to Run as administrator and the UAC confirmation on Windows.
Windows reference point:
aptcombines ideas from Windows Update and WinGet. Linux repositories provide both system updates and many applications.
Some minimal Debian installations do not include sudo yet. This case only applies when you are already connected as root. If the terminal displays sudo: command not found, run:
apt update
apt install sudo
apt updaterefreshes the package catalog withoutsudobecauserootalready has administrator privileges.apt install sudodownloads and installs the package that provides thesudocommand.
Do not run these lines from a normal account without administrator privileges: Linux will refuse them.
Install the first updates safely
If whoami displayed root, you already have administrator privileges and can remove sudo from the commands in this section. With a normal administrator account, keep it.
First refresh the software catalog:
sudo apt update
sudorequests administrator privileges.aptopens the package manager.updatedownloads the current list of packages and versions.
This command does not update any installed program yet. It only searches for available versions, like the first phase of Windows Update.
Now review and install the available updates:
sudo apt upgrade
upgradecompares installed packages with the refreshed catalog.- A summary is displayed before any change.
- Type
Y, then press Enter, if the proposed changes are acceptable.
Later, you may see this version:
sudo apt upgrade -y
-yautomatically answers yes to confirmation questions.- The option is convenient for known operations, but it removes the opportunity to review the summary.
For your first update, prefer the version without -y.
Windows reference point:
apt updatesearches for updates.apt upgradedownloads and installs them.
Set the time zone and verify clock synchronization
Correct time is essential for understanding logs, running scheduled tasks at the expected moment, and validating HTTPS certificates. Start by displaying the current configuration:
timedatectl status
timedatectlreads and configures the system clock.statusdisplays local time, Universal Time in UTC, the time zone, and network synchronization status.sudois not required because this command does not change anything.
Example output from a fresh Ubuntu 24.04 VPS:
Local time: Sun 2026-08-02 00:59:56 UTC
Universal time: Sun 2026-08-02 00:59:56 UTC
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
NTP service: active
Here, System clock synchronized: yes means that the clock is synchronized, and NTP service: active shows that network time synchronization is working. Depending on the Debian or Ubuntu version, synchronization may be handled by chrony or systemd-timesyncd. Do not install another time synchronization service before identifying the one already in use.
Display the available time zones when you do not know the exact identifier:
timedatectl list-timezones
list-timezonesdisplays recognized identifiers such asAmerica/New_York.- Use the arrow keys to browse and press
qto quit if the list opens in a pager.
Set the time zone for your region:
sudo timedatectl set-timezone America/New_York
sudoauthorizes a system setting change.set-timezonechanges the time zone used to display dates.America/New_Yorkis the example identifier to replace for another region.
Run timedatectl status again to verify the result.
Windows reference point: these commands correspond to the Windows Date & time settings. The time zone controls how dates are displayed, while NTP synchronization is comparable to “Set time automatically.”
Check automatic security updates
Manual checks with apt update and apt upgrade remain useful, but an always-connected server should also receive security fixes regularly. Ubuntu normally installs the unattended-upgrades package by default. A Debian or minimal image may not include or enable it.
First check whether the package is installed:
apt policy unattended-upgrades
apt policydisplays the installed and available version of a package.unattended-upgradesis the package that can automatically install approved updates.Installed: (none)means that the package is not installed.
Inspect the APT schedules known to systemd:
systemctl list-timers apt-daily.timer apt-daily-upgrade.timer --no-pager
systemctl list-timersdisplays tasks triggered on a schedule.apt-daily.timerperiodically refreshes package information.apt-daily-upgrade.timerstarts automatic update processing.--no-pagerprints the result directly in the terminal.
If the package is missing and you want this mechanism on Debian or Ubuntu:
sudo apt install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades
apt install unattended-upgradesinstalls the automatic update mechanism.dpkg-reconfigurereopens the configuration assistant for the installed package.- Answer yes when asked whether automatic security updates should be enabled.
This mechanism does not automatically update every manually downloaded application or every third-party repository. Continue to monitor your service, its backups, and its own security announcements.
Some kernel or core component updates require a restart. Do not restart in the middle of an operation. Check your backups, plan the interruption, and only when a restart is requested use:
sudo reboot
sudorequests administrator privileges.rebootstops services and restarts the VPS.- The SSH connection closes immediately and should become available again after boot.
Windows reference point:
unattended-upgradesis comparable to the automatic installation of security fixes by Windows Update.sudo rebootcorresponds to Restart, not Shut down.
Create a Linux user (optional)
On a BoxToPlay VPS, administration is generally done with the root account. Creating another user is not required to get started. It is useful when you want a separate login, an account for another person, or a simple example of Linux users.
Create a regular user:
sudo adduser newuser
id newuser
sudo adduser newusercreates the user, asks for its password, and creates/home/newuserwith administrator privileges.id newuserprints the user’s identifiers and groups.
By default, this user is not an administrator. If you want it to run commands with sudo, explicitly add it to the sudo group:
sudo usermod -aG sudo newuser
id newuser
sudo usermodchanges an existing user with administrator privileges.-ameans append without removing existing group memberships.-G sudoadds the user to the group namedsudo.
Windows reference point: creating the user alone is similar to creating a standard local account. Adding it to the
sudogroup gives it the ability to elevate selected commands, like a Windows account placed in the Administrators group.
If you test this new account, keep your root session open, open a second connection as newuser, then run:
sudo whoami
sudorequests elevated privileges and may ask for thenewuserpassword.whoamithen prints the identity used for the command.- The expected result is
root.
Do not close your original root session while changing SSH or firewall settings. It remains your recovery path if a new connection fails.
Replace password authentication with an SSH key
An SSH key uses a pair of files:
- the private key remains on your Windows computer and must never be shared.
- the public key is copied to the VPS and can safely identify your computer.
On Windows, generate a key:
ssh-keygen -t ed25519 -a 100
ssh-keygencreates and manages SSH keys.-t ed25519selects the modern Ed25519 key type.-a 100increases the work required to test each passphrase guess if the private key is stolen.- Press Enter to accept the proposed location, then choose a strong passphrase.
Copy the public key from Windows to the root account:
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | ssh [email protected] "umask 077; mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys"
Get-Contentreads the public key file on Windows.$env:USERPROFILErepresents your Windows profile folder.|sends the public key to thesshcommand.umask 077makes newly created files private to the remote account.mkdir -p ~/.sshcreates the remote.sshfolder if it does not exist.cat >> ~/.ssh/authorized_keysappends the key instead of erasing existing authorized keys.
Termix and the Windows OpenSSH client can use the private key created by ssh-keygen directly. For PuTTY, open PuTTYgen, choose Conversions > Import key, select the OpenSSH private key, and save it as a .ppk file. WinSCP can also use that .ppk file for authentication.
Create another root connection in Termix using the OpenSSH key, or in PuTTY using the .ppk file created with PuTTYgen. Your client may ask for the key passphrase, but it should no longer ask for the Linux account password.
Only after this test succeeds should you consider changing SSH authentication or disabling password login. Always preserve the BoxToPlay rescue console or another recovery method before changing SSH settings.
You can continue administering the VPS as root. If you created an additional user, configure its SSH key separately in that account’s own ~/.ssh/authorized_keys file.
Windows reference point: the private key is similar to a personal credential stored on your computer, while the public key acts like an allowed identity registered on the server.
Navigate through folders
Display your current location:
pwd
pwdmeans print working directory.- It prints the full path of the folder in which commands currently operate.
List its contents:
ls -lah
lslists entries.-ladds permissions, owner, size, and date.-aincludes hidden entries.-huses readable sizes.
Move to another folder:
cd /opt
cdmeans change directory./optis commonly used for manually installed applications.
Return to your personal folder:
cd ~
~expands to the current user’s home folder.
Move to the parent folder:
cd ..
..refers to one level above the current folder.
Windows reference point:
pwd,ls, andcdcorrespond approximately to PowerShellGet-Location,Get-ChildItem, andSet-Location. Windows paths use drive letters and backslashes, while Linux paths begin at/and use forward slashes.
Create, copy, move, and delete files
Create a service folder and enter it:
sudo mkdir -p /opt/my-service
sudo chown "$USER":"$(id -gn)" /opt/my-service
cd /opt/my-service
mkdircreates a folder.-palso creates missing parent folders and avoids an error if the folder already exists.chownchanges ownership."$USER":"$(id -gn)"assigns the current user and its primary group.cdenters the folder.
Create an empty file:
touch config.txt
touchcreatesconfig.txtif it does not exist.- If it already exists, its modification date is updated without changing its contents.
Copy the file:
cp config.txt config.backup.txt
cpcopies the first path to the second path.- The original file remains in place.
Rename or move the copy:
mv config.backup.txt old-config.txt
mvmoves an item.- When both paths are in the same folder, the visible result is a rename.
Delete the renamed file:
rm old-config.txt
rmremoves a file immediately.- A normal terminal session has no Recycle Bin.
Delete a folder and everything inside it only when you have verified the exact path:
rm -r folder-to-delete
-rmeans recursive and allowsrmto descend through a folder.- This can remove many files, so inspect the folder with
lsfirst. - Never copy a destructive command without replacing and checking its example path.
Windows reference point:
mkdir,cp,mv, andrmcorrespond to New folder, Copy, Cut or Rename, and Delete. The major difference is that command-line deletion is normally immediate.
Edit a text file with Nano
Install Nano if it is missing:
sudo apt install nano
sudorequests administrator privileges.apt installdownloads and installs a package.nanois the package name and the command that will become available.
Open a file:
nano /opt/my-service/config.txt
nanostarts the editor.- The path identifies the file to open or create.
In Nano:
- type normally to edit.
- press
Ctrl+O, then Enter, to save. - press
Ctrl+Xto leave. - press
Ctrl+Wto search. - the
^symbol displayed by Nano means the Ctrl key.
Windows reference point: Nano plays the role of a simple Notepad inside the terminal.
For a system file, include sudo:
sudo nano /etc/hosts
sudois required because/etc/hostsbelongs to the system./etccontains many system and application configuration files.
Create a backup before changing an important file:
sudo cp /etc/hosts /etc/hosts.backup
cpduplicates the original file.- The
.backupsuffix is only a readable naming convention.
Upload files and archives from Windows
SFTP with WinSCP
Create a WinSCP connection with:
- protocol: SFTP.
- host: your VPS IP address.
- port: your SSH port.
- user:
root. - authentication: your password or private key.
Drag files into /root/uploads first. This keeps the upload in the root home folder before you move it to the final application path.
Prepare that destination on the VPS:
mkdir -p ~/uploads
ls -ld ~/uploads
mkdir -pcreates theuploadsfolder in your home directory.ls -lddisplays the folder itself, including its owner and permissions.
SCP from PowerShell
Upload one archive:
scp "$env:USERPROFILE\Downloads\app.zip" [email protected]:/root/uploads/
scpsecurely copies files through SSH.- The Windows path before the space is the local source.
[email protected]:identifies the remote account and server./root/uploads/is the destination.
With a custom SSH port:
scp -P 2222 "$env:USERPROFILE\Downloads\app.zip" [email protected]:/root/uploads/
- SCP uses uppercase
-Pfor its port option. - This differs from SSH, which uses lowercase
-p.
Download a file from the VPS:
scp [email protected]:/var/log/my-service/app.log "$env:USERPROFILE\Downloads\"
- The remote path appears first because it is the source.
- The Windows Downloads folder appears second because it is the destination.
Inspect and extract archives
Install common archive tools:
sudo apt install unzip zip p7zip-full xz-utils
apt installcan install several packages separated by spaces.unzipextracts.ziparchives.zipcreates.ziparchives.p7zip-fulladds 7-Zip format support.xz-utilshandles.xzcompression.
Inspect an archive before extracting it:
unzip -l ~/uploads/app.zip
unziphandles the ZIP file.-llists its contents without extracting them.- Inspecting names first helps detect an unexpected layout or suspicious paths.
Create an isolated destination in your home folder and extract the ZIP there first:
mkdir -p ~/imports
unzip ~/uploads/app.zip -d ~/imports
ls -la ~/imports/my-service
mkdir -pprepares a dedicated staging folder.unzipreads the uploaded archive.-dselects the extraction directory.ls -lalets you review the extracted files before moving them into the final application folder.
List a .tar.gz archive:
tar -tzf ~/uploads/archive.tar.gz
tarmanages tar archives.-tlists contents.-zuses gzip compression.-fmeans the next argument is the archive file.
Example output for a small archive:
my-service/
my-service/config/
my-service/config/config.yml
If you see absolute paths such as /etc/..., paths containing ../, or unexpected files, stop before extracting and verify the archive source.
Extract it into the same isolated folder:
mkdir -p ~/imports
tar -xzf ~/uploads/archive.tar.gz -C ~/imports
ls -la ~/imports/my-service
-xextracts.-zdecompresses gzip.-fselects the archive.-Cchanges to the destination before extracting.mkdir -pis repeated here so the tar example also works if you did not extract a ZIP first.- Adjust
~/imports/my-serviceif the archive contains a different top-level folder.
After checking the extracted folder, copy its content to the final service path:
sudo mkdir -p /opt/my-service/releases/new
sudo rsync -a ~/imports/my-service/ /opt/my-service/releases/new/
sudo mkdir -pcreates the final system folder if needed.rsync -acopies the extracted content while preserving common file metadata.
Windows reference point: these commands perform the same job as Extract All or 7-Zip. On a server, listing the contents first is particularly important because an archive may come from an external source.
Install a practical starter toolbox
Install a small set of widely useful tools:
sudo apt install curl wget git htop tree jq rsync ca-certificates
Each package has a distinct purpose:
curlsends web requests and is useful for testing an HTTP endpoint.wgetdownloads a file from a URL.gitretrieves and updates source repositories.htopdisplays processes, CPU, and memory interactively.treedisplays folders as a tree.jqreads and filters JSON.rsyncsynchronizes files efficiently.ca-certificatesprovides the trusted certificate authorities used by HTTPS connections.
Windows reference point: WinGet can install applications on Windows. On Debian and Ubuntu,
aptinstalls these tools and their dependencies from configured repositories.
Do not install a command merely because an online guide mentions it. Check the official documentation, package source, and purpose first.
Understand useful hosting folders
Start by exploring without changing files:
pwd
ls -lah
cd /opt
ls -lah
cd ~
pwdmeans « print working directory » and displays the path of the current folder. The PowerShell equivalent isGet-Location.ls -lahdisplays detailed contents, including hidden entries, with readable sizes. The PowerShell equivalent isGet-ChildItem -Force.cd /optmoves your terminal into/opt. The PowerShell equivalent isSet-Location.- The second
ls -lahdisplays the content of/opt. cd ~returns to your home folder.
The main locations are:
/root: home folder of therootaccount, similar toC:\Users\Administrator./home/user: home folder of a user created withadduser, similar toC:\Users\User./opt/my-service: common location for a standalone application, similar toC:\Program Files\MyService./etc/my-service: system configuration, with no single Windows equivalent./var/lib/my-service: persistent application data, similar toC:\ProgramData\MyService./var/log: many system and application logs, similar to Event Viewer and Windows log folders./var/www: files for a classic web server, similar toC:\inetpub\wwwrootwith IIS./tmp: temporary files, similar to%TEMP%.
A path starting with / is absolute: it starts at the system root. A path without a leading / is relative to the folder shown by pwd.
Understand users, groups, and permissions
Linux does not give every account the same access. Each file and folder has an owner, a group, and separate permissions for the owner, the group, and everyone else. This prevents a service, script, or local user from reading or changing files that do not belong to it.
Inspect a folder and a file:
ls -ld /opt/my-service
ls -l /opt/my-service/config/config.yml
Example output:
drwxr-x--- 3 myservice myservice 4096 Aug 2 02:34 /opt/my-service
-rw-r----- 1 myservice myservice 17 Aug 2 02:34 /opt/my-service/config/config.yml
The beginning of each line shows the type and permissions:
dmeans directory,-means regular file.rmeans read.wmeans write.xmeans execute for a file, or enter/traverse for a directory.- The first three permissions apply to the owner.
- The next three apply to the group.
- The last three apply to everyone else.
In the example, /opt/my-service can be read and entered by the owner and group, but not by other users. The config.yml file can be read and changed by its owner, read by the group, and hidden from everyone else.
Create a service account that cannot open an interactive session, then assign the full folder to it:
sudo useradd --system --user-group --home-dir /opt/my-service --shell /usr/sbin/nologin myservice
sudo chown -R myservice:myservice /opt/my-service
useraddcreates an account.--systemmarks it as a service account.--user-groupalso creates amyservicegroup.--home-dir /opt/my-serviceassigns the application folder as its home.--shell /usr/sbin/nologinprevents normal terminal login.chown -Rchanges the owner and group recursively.
Protect a configuration file that contains a secret:
sudo chmod 640 /opt/my-service/config/config.yml
6gives the owner read and write access.4gives the group read-only access.0gives everyone else no access.
To change permissions for a whole directory that already contains files, use a recursive command:
sudo chmod -R u=rwX,g=rX,o= /opt/my-service
chmod -Rapplies the permissions to all existing content.u=rwXgives the owner read and write access, plus directory access.g=rXgives the group read access and directory traversal.o=removes all access for everyone else.- The uppercase
Xadds execute permission only to directories and files that are already executable, which avoids making every file executable by mistake.
This is useful after extracting an archive, uploading files with SFTP, or restoring a backup, when ownership is wrong or permissions are too open.
Never use chmod -R 777 as a general fix. It gives every local user permission to read, change, and execute the content. It hides the real problem and weakens security.
Windows reference point: owner, group, and mode bits serve a role comparable to file ownership and NTFS access-control entries, but Linux often expresses common permissions with short symbols or numbers.
Monitor CPU, memory, disk, and processes
Open the interactive process view:
htop
htopdisplays CPU, memory, and running processes.- Use the arrow keys to navigate and
F10orqto quit.
Windows reference point:
htopis the closest equivalent to Task Manager.
Check memory:
free -h
freereports RAM and swap usage.-huses readable units.- On Linux, memory used for cache can be reclaimed, so the
availablevalue is often more useful thanfree.
Check disk space:
df -h
dfreports free and used space for mounted file systems.-huses GB and MB.- Pay attention to the row mounted on
/.
Example output for free -h and df -h /:
Mem: 15Gi 554Mi 14Gi
Swap: 7.8Gi 0B 7.8Gi
/dev/sda2 99G 12G 83G 12% /
Here the main file system mounted on / is 12% used, and the memory overview shows that most RAM is still available.
Measure one folder:
du -sh /opt/my-service
dumeasures disk usage.-sprints one total.-huses readable units.- The path selects the folder to measure.
List processes matching a name:
ps aux | grep myservice
ps auxlists running processes with their owners and resource usage.|passes that list to the next command.grep myservicekeeps lines containingmyservice.- The
grepcommand itself may also appear in the result.
Windows reference point:
free,df,du, andpscorrespond broadly to the Performance tab, Storage settings, folder properties, and the Details tab in Task Manager.
Check listening ports and test a local service
Display listening TCP and UDP sockets:
sudo ss -tulpn
ssdisplays network sockets.-tincludes TCP.-uincludes UDP.-lkeeps listening sockets.-pdisplays the associated process when permissions allow it.-nkeeps addresses and ports numeric.
Useful example lines:
tcp LISTEN 0 4096 0.0.0.0:22 0.0.0.0:* users:(("sshd"))
tcp LISTEN 0 511 0.0.0.0:80 0.0.0.0:* users:(("nginx"))
0.0.0.0:22 means SSH is listening on all IPv4 interfaces. 127.0.0.1:8080 would mean that the service only listens from the VPS itself.
Check a specific port:
sudo ss -tulpn | grep ':8080'
- The first command creates the socket list.
|passes it togrep.grep ':8080'keeps rows containing port8080.
Test a web service from the VPS itself:
curl -I http://127.0.0.1:8080
curlsends the HTTP request.-Irequests response headers only.127.0.0.1means this same machine.:8080selects port8080.
A local response such as HTTP/1.1 200 OK means the application answers from the VPS itself. If the same service is unreachable from the internet, check the listening address, Linux firewall, BoxToPlay-side network rules, and reverse proxy.
Windows reference point: these checks correspond to
Get-NetTCPConnectionandInvoke-WebRequestin PowerShell.
A process listening locally is not automatically reachable from the internet. The application address, Linux firewall, BoxToPlay-side network rules, NAT, and reverse proxy can all affect access.
Keep an application running with systemd
Starting an application directly in SSH often ties it to the terminal. systemd is the service manager used by most current Debian and Ubuntu servers. It can start an application at boot, restart it after a failure, and collect logs.
In this example, the application provides /opt/my-service/start.sh. Always adapt this path to the software documentation.
Make the startup script executable and assign the service files to the service account:
sudo chmod +x /opt/my-service/start.sh
sudo chown -R myservice:myservice /opt/my-service
chmod +xadds permission to execute the script.chown -Rrecursively assigns the application to themyserviceaccount.
Create the service definition:
sudo nano /etc/systemd/system/myservice.service
sudois required to write under/etc.nanoopens the editor.- Files ending in
.servicedefine systemd services.
Example:
[Unit]
Description=My hosted service
After=network-online.target
[Service]
Type=simple
User=myservice
Group=myservice
WorkingDirectory=/opt/my-service
ExecStart=/opt/my-service/start.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
[Unit]describes the service and its startup dependencies.After=network-online.targetplaces it after the network-online target.[Service]defines how the process runs.UserandGroupavoid running it as root.WorkingDirectorysets the current folder.ExecStartis the exact executable and arguments. It is not an unrestricted shell line.Restart=on-failurerestarts the process after an unexpected failure.[Install]defines how the service is attached to normal system startup.
Tell systemd to reread its files:
sudo systemctl daemon-reload
systemctlmanages systemd.daemon-reloadreloads service definitions without restarting the whole VPS.
Enable and start the service:
sudo systemctl enable --now myservice
enableconfigures automatic startup at boot.--nowalso starts it immediately.myservicerefers tomyservice.service.
Check its state:
sudo systemctl status myservice
statusshows whether the service is active and includes recent log lines.- Press
qif the display opens in a pager.
Restart after a configuration change:
sudo systemctl restart myservice
restartstops and starts the service.- Use it only after saving and, when possible, validating the configuration.
Windows reference point: systemd services correspond to Windows Services.
systemctlserves a role similar to the Services console orsc.exe.
Read logs with journalctl
Display the service log:
sudo journalctl -u myservice
journalctlreads logs collected by systemd.-u myservicefilters one unit.
Show the latest lines and continue following new entries:
sudo journalctl -u myservice -n 100 -f
-n 100starts with the latest 100 lines.-ffollows new lines in real time.- Press
Ctrl+Cto stop following without stopping the service.
Show logs since the current boot:
sudo journalctl -u myservice -b
-blimits the result to the current system boot.
Windows reference point:
journalctlfills a role similar to Event Viewer, while-fresembles watching a log file update live.
Configure a firewall without locking yourself out
Ubuntu commonly uses UFW as a simpler interface to the underlying firewall. Debian may use nftables directly or may not have UFW installed. Use one firewall management method at a time so that rules remain understandable.
Install UFW only when you deliberately choose it:
sudo apt install ufw
apt installinstalls the firewall management tool.- Installing UFW does not automatically enable it.
Display its current state before adding or enabling anything:
sudo ufw status verbose
ufwmanages the firewall.statusreports whether it isactiveorinactive.verbosealso displays default policies and more detail.- This command does not change any rule.
On a server where UFW is not active yet, you may see:
Status: inactive
This means the tool is present, but this firewall is not currently enforcing rules.
Check that the predefined SSH profile exists:
sudo ufw app list
app listdisplays the application profiles registered with UFW.- Confirm that
OpenSSHappears before using that profile name.
Allow SSH before the first activation:
sudo ufw allow OpenSSH
ufw allowadds an inbound allow rule.OpenSSHnormally covers TCP port22and keeps administrative SSH access available.- This rule does not open your application’s port.
Allow a custom SSH port when required:
sudo ufw allow 2222/tcp
2222is the example port to replace./tcplimits the rule to the TCP protocol used by SSH.
If the first status was inactive, activate UFW only after preparing the SSH rule:
sudo ufw enable
enableactivates the firewall and its prepared rules.- If UFW was already active, new rules apply immediately and this command is unnecessary.
- Keep the existing SSH session open while you test a second connection.
Inspect the resulting rules:
sudo ufw status numbered
status numberedlists active rules with numbers that can later be used to manage them.
Open normal web ports only when the VPS hosts a public website:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
- Port
80/tcpis used for HTTP. - Port
443/tcpis used for HTTPS.
Open an application port such as 8080/tcp only when you deliberately want that application to be directly reachable from the internet. For a web application behind Nginx or Apache, keep the application on 127.0.0.1:8080 and open only the public proxy ports.
Windows reference point: UFW is comparable to Windows Defender Firewall rules. BoxToPlay-side network rules, when configured, add another layer much like a network firewall outside the computer.
If the system image or the delivered VPS configuration already manages nftables or iptables, do not activate UFW on top of it. You can inspect the existing configuration without changing it:
sudo nft list ruleset
sudo iptables -S
nft list rulesetdisplays all rules currently known to nftables.iptables -Sdisplays the current iptables rules as commands.- Both commands are read-only. Follow the distribution method or the BoxToPlay documentation that owns those rules.
Always preserve SSH access and a recovery console.
Add a domain name, reverse proxy, and HTTPS
A web application often listens only on 127.0.0.1:8080. A reverse proxy such as Nginx receives public requests on ports 80 and 443, then forwards them to the internal application.
If the application does not already include reliable authentication, do not expose it directly to the whole internet. Add a dedicated protection layer, such as Nginx Basic Auth, an IP restriction, or private access.
The usual sequence is:
- Create the DNS record for your domain and point it to the VPS IP.
- Keep the application on a local port when possible.
- Configure Nginx for the domain.
- Test the configuration.
- Obtain an HTTPS certificate.
Install Nginx:
sudo apt install nginx
apt installinstalls Nginx and its systemd service.- The package normally starts the web server automatically.
Create a virtual host file:
sudo nano /etc/nginx/sites-available/example.com
- The file name usually matches the domain for readability.
sites-availablestores configurations that can be enabled.
Example:
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
listen 80accepts HTTP connections.server_nameselects requests for the domain.location /applies to all paths.proxy_passforwards requests to the local application.- The forwarded headers help the application know the original visitor address and protocol.
Enable the site:
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com
lncreates a link.-screates a symbolic link rather than a second copy.- Nginx reads enabled site links from
sites-enabled.
Test the configuration:
sudo nginx -t
nginxruns the Nginx program.-tchecks configuration syntax without applying it.
A healthy result looks like this:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Reload Nginx only after a successful test:
sudo systemctl reload nginx
reloadasks Nginx to reread its configuration while keeping the service available.
To generate an HTTPS certificate on Debian or Ubuntu with Nginx, install Certbot and run the Nginx assistant:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com
python3-certbot-nginxlets Certbot read and adapt the Nginx configuration.certbot --nginxrequests the certificate and can add the HTTPS configuration automatically.- Replace
example.comwith your real domain and follow the questions shown by Certbot.
Windows reference point: Nginx as a reverse proxy is comparable to using IIS with reverse-proxy rules and a TLS certificate.
Back up before an update
A backup is useful only if it contains the required data and can be restored.
The example below backs up only /opt/my-service. If your application uses MySQL, MariaDB, PostgreSQL, or another database, also create a dedicated database export.
Create a compressed archive and make it readable only by your account:
backup=~/backups/my-service-$(date +%F-%H%M).tar.gz
mkdir -p ~/backups
sudo tar -czf "$backup" -C /opt my-service
sudo chown "$USER":"$(id -gn)" "$backup"
chmod 600 "$backup"
tar -tzf "$backup" | head
backup=...stores the archive path once so the following commands reuse the same file.mkdir -p ~/backupscreates the backup folder in your home directory.tar -czfcreates (c) a gzip-compressed (z) archive in the selected file (f).$(date +%F-%H%M)inserts the current date and time in the file name.-C /opt my-servicetellstarto switch to/optand archive themy-servicefolder.chownreturns the archive to the connected account so it can be downloaded.chmod 600restricts archive access to its owner because backups can contain secrets.tar -tzflists the archive content to confirm it can be read.
Example output:
my-service/
my-service/config/
my-service/config/config.yml
This does not prove that the full restore will work, but it already catches an unreadable or empty archive.
Synchronize the service folder to another mounted destination:
sudo rsync -a /opt/my-service/ /mnt/backups/my-service/
rsyncsynchronizes two folders.-apreserves common metadata and copies recursively.- The trailing slash on
/opt/my-service/means copy the folder contents. - If you later want the destination to mirror deletions too, test on a throwaway folder first and check the source and destination paths carefully.
Windows reference point:
rsyncis similar in purpose torobocopy, and a tar archive is comparable to a ZIP backup. Neither becomes an off-site backup if it remains on the same VPS disk.
Keep at least one copy on another machine or storage service, and test a restoration in an isolated folder.
Maintain the VPS
For a regular check:
sudo apt update
sudo apt upgrade
sudo systemctl --failed
df -h
free -h
apt updatelooks for currently available package versions.apt upgradeproposes their installation.systemctl --failedlists systemd services currently in failure state.df -hchecks disk space.free -hchecks memory.
Windows reference point: this covers the role of Windows Update, the Services console, Task Manager, and the Storage view.
Read the proposed changes before a major update, then check the status and logs of your services.
A safe workflow for installing any service
When you later install a website, bot, API, database, or game tool, follow this order:
- Read its official prerequisites and identify the runtime, ports, and persistent folders.
- Connect through SSH with the BoxToPlay
rootaccount. - Install only the required dependencies with
apt. - Create a dedicated folder under
/optor use the documented location. - Upload or download files from the official source.
- Inspect archives before extracting them into an isolated folder.
- Create a service account and apply limited permissions.
- Store configuration and secrets with restrictive access.
- Run the application locally and read its logs.
- Configure durable startup with systemd or Docker.
- Test its local port on
127.0.0.1. - Configure the firewall, DNS, reverse proxy, and HTTPS when required.
- Prepare a backup and verify a restoration.
If the application is better suited to containers, continue with our guide: Install Docker on Linux: A Practical Getting-Started Guide.
VPS readiness checklist
Before putting a service online, confirm that:
- you understand each command before running it.
- the time zone is correct and the clock is synchronized.
- your automatic security update strategy has been checked.
- you can connect as
rootand you understand whether any additional user hassudoprivileges. - SSH key authentication works from a second terminal.
- the system and installed packages are updated.
- the application runs under a dedicated account.
- configuration files and secrets are not readable by everyone.
- you know how to inspect CPU, memory, disk, processes, ports, and logs.
- the firewall keeps SSH available and opens only required ports.
- the application can restart after a reboot.
- a backup exists outside the VPS and a restoration has been tested.
Choose a VPS sized for your service
A good setup also depends on sufficient CPU, RAM, storage, and network capacity. You can compare available configurations on the BoxToPlay VPS hosting page.
Start with the resources your application actually needs, monitor real usage, and increase the plan only when the measurements justify it.
