Some useful commands if you are not that familiar with linux and just want to setup a new linux server
Note
All commands are only tested on a Debian 12 machine
so they might not work if you are using a different operating system
Is equivalent to the windows task manager
htop
cd <path>
You can use
cd ..to go to the parent diretory / go back
mkdir <name>
You can use rm -r to delete a directory recursively
rm <file-name>
cat <file-name>
touch <file-name>
cp -r /path/ /new/path/
sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
sudo systemctl restart nginx
For a https connection
sudo apt update
sudo apt install certbot python3-certbot-nginx
Important The domain must point to your root servers IP
sudo certbot --nginx -d yourdomain.com
Compress files/folders to a tar.gz file
One folder
tar -czvf archive.tar.gz /path/to/folder
Multiple folders
tar -czvf archive.tar.gz /path/to/folder1 /path/to/folder2 /path/to/folder3
tar -xzf archive.tar.gz
In this example we are using the generated tar.gz
Note
You need the password for the <DestinationServerIP> to upload the file
scp -r /path/archive.tar.gz root@DestinationServerIP:/path
wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz
tar -xvf jdk-21_linux-x64_bin.tar.gz
mv jdk-21.0.6/ /opt/
sudo nano /etc/profile.d/jdk.sh
Add lines:
export JAVA_HOME=/opt/jdk-21.0.6
export PATH=$JAVA_HOME/bin:$PATH
Close & save file
source /etc/profile.d/jdk.sh
wget https://download.oracle.com/java/25/archive/jdk-25.0.1_linux-x64_bin.tar.gz
tar -xvf jdk-25.0.1_linux-x64_bin.tar.gz
mv jdk-25.0.1/ /opt/
sudo nano /etc/profile.d/jdk.sh
Add lines:
export JAVA_HOME=/opt/jdk-25.0.1
export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile.d/jdk.sh