I have read a lot of stuff on here & elsewhere, but still not getting any joy.

I am running Linux Mint 17. The rest of my family are on Windows 7. I can join their LAN worlds, but they can't connect to mine.

I have tried editing the hosts file as in Can't set up a local LAN server on Minecraft 12w25a? et al, but that hasn't helped. My hosts file now looks like this:

XXX.XXX.XXX.XXX MYPC   localhost

# The following lines are desirable for IPv6 capable hosts
::1     MYPC localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

(My IP address & pc name are definitely correct in the real world)

I have run UFW commands to open port 25565 thus: (https://computerobz.wordpress.com/2014/06/13/how-to-minecraft-server-on-ubuntu/)

sudo ufw allow 22

Once that rule has been added then we can enable the firewall:

sudo ufw enable

Now we need to enable the other ports we are going to be using. Minecraft runs on a default port of 25565. Run the following command to add the port.

sudo ufw allow 25565

Check the Firewall status to make sure all is setup right:

sudo ufw status

25565 is set to "allow"

The server & port shows up on the Windows PC, just times out.

Any ideas where I go from here please?

  • Have you verified that your port is actually open on the router level? Try going to canyouseeme.org and enter your port number, and check.
    – Zymus
    Mar 3, 2016 at 21:15
  • @Zymus Port forwarding will probably not help, because they are all already on the same network, since they're using LAN.
    – user139899
    Mar 3, 2016 at 21:18
  • I'm very sketchy on port forwarding etc - I did understand that being on a LAN only, everything took place behind the router/firewall. If I go to canyouseemee I can see an IP address that I don't recognise & port 80
    – Mr Trog
    Mar 3, 2016 at 21:23
  • @Ghalid, even within the local network, the connection goes through the router. If the machine that's hosting the server isn't allowed access through that port, it will still be blocked. The only exception would be if the two machines are literally networked together through one ethernet cable.
    – Zymus
    Mar 3, 2016 at 21:24
  • @Zymus I believe I have hosted a LAN before without port-forwarding, and others were able to connect to it.
    – user139899
    Mar 3, 2016 at 21:25

1 Answer 1


Opening Minecraft to LAN does not use the port 25565; instead it uses a different port each time. You can use

sudo ufw allow <port>

to open the port and change <port> with the port that Minecraft chose when opening to LAN. Or, if you want convenience, you can allow any connections from your local network here(assuming you trust everyone in your network... which you probably should!)

ufw allow from to any

Change to the IP range for your network.

Source: Ubuntu UFW Community Help Wiki specifically:

Allow by Subnet

You may use a net mask :

sudo ufw allow from Allow by specific port and IP address

sudo ufw allow from to port example: allow IP address access to port 22 for all protocols

sudo ufw allow from to any port 22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .