Port already in use, what to do?

Hi, just tried to setup Discourse and all went good except for launching it.
It gives the following error:

starting up existing container
+ /usr/bin/docker start app
Error response from daemon: Cannot start container app: Error starting userland proxy: listen tcp bind: address already in use
FATA[0000] Error: failed to start one or more containers

Which suggests the port is already in use. On the system we run a web (apache, teamspeak and minecraft server.
I am not the best with Linux and Apache, so I was wondering if anyone could help.

Thanks in advance, if you need any more information, let me know.


Thanks for the quick reply,

I am not sure though if I am capable of doing all of that, I am really a beginner with Linux and the stuff there seems quite tricky, especially since it has to be configured with other webservices as well (Or so it seems according to the last part of the guide, suggesting to add other services to the proxy as well.)

Anyways, will see if I can manage.

I managed to get it running (the container, that is) but I don’t really understand yet what port it runs on and how I can access it. forum.mydomain.com gives me nothing, probably because I haven’t set up DNS yet? and wouldn’t know where else it should be on. :4001 doesn’t work either but tinkering with firewall now.

Do you know what I am doing wrong?

This error comes up often enough that I think our startup scripts should offer guidance for it. I am getting really sick of reading the “oh no, port 80 is in use” install topics.


Sorry, just not good with Linux to figure all of this out by myself.

Not a problem, just pointing out that this comes up a LOT. And our scripts should offer advice when it does, automatically.

I understand. That’d be very useful. I think I set things up correctly now with @riking’s way - if that’s the advice you mean - it’s just that it refuses the connection when I try to connect to mydomain:4001 (All ports in that topic mentioned that so I am figuring that is the point it redirects it to?)

The first post isn’t using port 4001 anymore, but rather a UNIX socket connection to get into the container. It’s supposed to get you to set up a nginx on the host that proxies to either Discourse or your other sites.

I followed everything in your guide except for the firewall part since I thought that was only for security and can be done later when stuff actually works, and because even in the replies there were a couple of issues with it.

I set up nginx correctly with atleast Discourse, but I still can’t acces discourse. Do I have to do anything on the DNS side to be able to connect to the Discourse subdomain?

Is nginx actually running? on port 80?

Well to me it seems it’s not, according to these;

Could it be because Apache is already listening to it?

So I managed to make nginx listen to port 80

Apache listens to port 8080 and is redirected by nginx to mydomain.com

Still, discourse doesn’t appear on forum.mydomain.com

Here are some of the config files:
App.yml https://gist.github.com/Exuraz/a9fc1f151b67837fc9ca
nginx main site https://gist.github.com/Exuraz/e633ec63099a9cd5e8af
nginx discourse https://gist.github.com/Exuraz/0ec996e5b1252b6b6cfc
Apache main site https://gist.github.com/Exuraz/b44bbaeebe3ab2f18b90

1 Like
$ curl http://forum.noodlepowered.com
curl: (6) Could not resolve host: forum.noodlepowered.com

You don’t have DNS set up.

Ah okay thanks, I suppose theres instructions on that somewhere too so wil figure that out. Atleast Nginx runs properly now, thanks for the help :slight_smile:

You’ll want to go to your DNS provider and Cloudflare (which might be the same thing) and set up forum. to point to the same IP address. Make sure to disable content optimizations in CloudFlare - they mess up the Discourse JS.

Alright not sure if we have cloudflare but will see if I can get things to work. Thankou very much for the help :slight_smile:

I’m pretty sure you do:

noodlepowered.com.	10800	IN	SOA	greg.ns.cloudflare.com. dns.cloudflare.com. 2018181667 10000 2400 604800 3600

(SOA = Source Of Authority or something)

Will this ever happen?

Would this be something that might happen at some point? I’m trying to get Discourse to bind to an alt port (9000?) like I recall vaguely that it used to. It seems that there’s always been some ambiguity on how to bind this to other IP’s on the host or even alternate ports.