Question

How to access minecraft server only on a specific port?

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”.


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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