Setting up MineCraft Server in Ubuntu

To setup MineCraft server on Ubuntu, first you need to install Java.

apt install openjdk-8-jre -y

Create a user to run minecraft

useradd -m --shell /bin/bash minecraft

You can set a password if you want direct SSH login to this user or login as root, then “su – minecraft”.

passwd minecraft

Login as user minecraft with SSH or “su”.

Download minecraft server .jar file from

At the time of writing, i downloaded


Don’t use above link as it can get older, always go to minecraft site and get new link, so you get latest minecraft server jar file.

You can start minecraft server with command

java -Xmx1024M -Xms1024M -jar server.jar nogui

First time when you run, it exit with some error related to EULA.

You need to edit file

vi eula.txt



Now minecraft will run. You can create a file with following command for starting minecrat easily.

vi ~/

Paste following content


java -Xmx1024M -Xms1024M -jar server.jar nogui

To make the file executable, chmod it 755

chmod 755 ~/

When you start minecraft from terminal/ssh, it get closed when you disconnect. To keep minecraft server running after you disconnect, use tmux or screen.

Need help with Linux Server or WordPress? We can help!

Leave a Reply

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