Ubuntu – pierwsza konfiguracja VPS pod Minecraft Ubuntu – First VPS Setup for a Minecraft Server

Po zakupie VPS wiele osób nie wie, od czego zacząć. W tym poradniku pokażę krok po kroku, jak przygotować Ubuntu pod serwer Minecraft: aktualizacje, Java, firewall i uruchamianie serwera w tle.

After buying a VPS, many people don’t know where to start. This guide shows step by step how to prepare Ubuntu for a Minecraft server: updates, Java, firewall, and running the server in the background.

Ubuntu VPS – konfiguracja pod Minecraft (PL) Ubuntu VPS Minecraft setup (EN)

Zakładam, że masz już dostęp SSH do VPS (login + hasło lub klucz SSH).


Krok 1: Aktualizacja systemu

sudo apt update && sudo apt upgrade -y

Zawsze zaczynaj od aktualizacji systemu.


Krok 2: Instalacja Javy

Dla nowszych wersji Minecraft zalecana jest Java 17 lub 21.

sudo apt install openjdk-17-jdk -y

Sprawdź wersję:

java -version

Krok 3: Firewall (UFW)

Zabezpiecz VPS przed niepotrzebnymi połączeniami:

sudo ufw allow OpenSSH
sudo ufw allow 25565/tcp
sudo ufw enable

Sprawdź status:

sudo ufw status
Uwaga Zawsze dodaj OpenSSH zanim włączysz UFW – inaczej odetniesz sobie dostęp.

Krok 4: Folder serwera

mkdir minecraft
cd minecraft

Tu będzie znajdował się cały serwer.


Krok 5: Uruchamianie serwera w tle (screen)

Instalacja screen

sudo apt install screen -y

Nowa sesja

screen -S minecraft

Uruchomienie serwera

java -Xms4G -Xmx4G -jar paper.jar nogui

Odłączanie sesji

Kombinacja klawiszy:

CTRL + A + D

Powrót do serwera

screen -r minecraft

Krok 6: Automatyczny start (opcjonalnie)

Na tym etapie wystarczy screen. Systemd można dodać później.


Szybka checklista

  1. System zaktualizowany.
  2. Java zainstalowana.
  3. Firewall skonfigurowany.
  4. Serwer działa w screen.

Najczęstsze błędy

„Nie mogę się połączyć z serwerem”

  • Port 25565 nieotwarty.
  • Firewall zablokowany.

„Java nie działa”

  • Zła wersja Javy.
  • Brak pamięci RAM.

„Serwer się wyłącza po zamknięciu SSH”

  • Brak screen/tmux.

I assume you already have SSH access to your VPS (login + password or SSH key).


Step 1: System Update

sudo apt update && sudo apt upgrade -y

Always start by updating the system.


Step 2: Installing Java

For newer Minecraft versions, Java 17 or 21 is recommended.

sudo apt install openjdk-17-jdk -y

Check the version:

java -version

Step 3: Firewall (UFW)

Secure your VPS against unnecessary connections:

sudo ufw allow OpenSSH
sudo ufw allow 25565/tcp
sudo ufw enable

Check status:

sudo ufw status
Warning Always add OpenSSH before enabling UFW – otherwise, you will lock yourself out.

Step 4: Server Folder

mkdir minecraft
cd minecraft

The entire server will be located here.


Step 5: Running the server in the background (screen)

Install screen

sudo apt install screen -y

New session

screen -S minecraft

Starting the server

java -Xms4G -Xmx4G -jar paper.jar nogui

Detaching the session

Key combination:

CTRL + A + D

Returning to the server

screen -r minecraft

Step 6: Auto-start (Optional)

At this stage, screen is enough. Systemd can be added later.


Quick checklist

  1. System updated.
  2. Java installed.
  3. Firewall configured.
  4. Server running in screen.

Common Errors

"I can't connect to the server"

  • Port 25565 is not open.
  • Firewall is blocking the connection.

"Java is not working"

  • Wrong Java version.
  • Not enough RAM.

"Server shuts down after closing SSH"

  • Missing screen/tmux.