New

EmeraldHost 2.0 is here: faster, more intuitive, and made for everyone - the new panel!

Learn more
Guides

How to Use Screen on Your Linux VPS

Use Screen on a Linux VPS (Ubuntu/Debian)

2 min read
Apr 1, 2026

With Screen you can run terminal sessions in the background. This way processes like a Minecraft server keep running even when you close the SSH connection.

Install Screen

  1. Update system
    First, update the package lists:

    sudo apt update
    
  2. Install Screen
    Install Screen with the following command:

    sudo apt install screen -y
    

Use Screen

Start a new session

Start a new Screen session with a name:

screen -S my-session

You are now inside the Screen session and can run commands.

Detach session

To keep the session running in the background, press:

Ctrl + A, then D

The session will continue running in the background, even if you close the SSH connection.

List sessions

Show all running Screen sessions:

screen -ls

Reattach session

Reconnect to a running session:

screen -r my-session

End session

To completely end a session, type inside the session:

exit

Example: Minecraft Server

  1. Start Screen session
    Create a new session for the Minecraft server:

    screen -S minecraft
    
  2. Start server
    Navigate to the server directory and start the server:

    cd /home/minecraft/server
    java -Xmx4G -Xms4G -jar server.jar nogui
    
  3. Detach session
    Press Ctrl + A, then D. The Minecraft server will continue running in the background.

  4. Reconnect later
    To open the server console again:

    screen -r minecraft
    

All commands

Command Description
screen -S name Start a new session with name
screen -ls List all sessions
screen -r name Reattach to a session
Ctrl + A, D Detach session
exit End session
Written byEmeraldHost Team
Last updated on Apr 1, 2026 Edit on GitHub

Did this article help you?

Your feedback helps us improve our guides.

Help shape the guides

€10.00 in credit for every new guide, €5.00 for every improvement.

Contact Support

Create a support ticket and our team will get back to you as soon as possible – personal and professional.

Go to Support
1257 members online

Discord Community

Connect with other players, get quick help from the community, and stay up to date with the latest news.

Join Discord

Join our Discord community 1257 members online right now