Report this

What is the reason for this report?

How to access minecraft server only on a specific port?

Posted on February 18, 2020

I’ve changed the minecraft server’s port to a different one and created an SRV and A record for it, but the minecraft server still works when I go to “domain.com” and I only want it to work when I go on “mc.domain.com” or “domain.com:0000”.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @usernameunlocked,

You’ll first need to edit the configuration file of your Minecraft Server and set the port to be 0000, I think by default it’s something like 25026.

As soon as you’ve done that, you’ll need to restart your Minecraft server. To test everything is actually working type in

netstat -tulpen | grep 0000

If you see the instance running then everything is okay. Now you’ll need to edit your firewall configuration.

If you are using UFW, you can enable the port by executing the following command

sudo ufw allow 0000/tcp

To actually check if it’s enabled or not, type in

sudo ufw status numbered

Regards, KDSys

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.