How to specify a different port (not 80) during installation?


I am installing this on the production server, which I already have a website running on port 80.

How do I specify a different port to install Discourse?

Currently it won’t let me install and says:

# ./discourse-setup
Port 80 appears to already be in use.

If you are trying to run Discourse simultaneously with another web
server like Apache or nginx, you will need to bind to a different port


However the above link says “assumes you already have Discourse working”, but I don’t.

(Matt Palmer) #2

Yes, that does appear to be something of a chicken-and-egg problem… what the discourse-setup script does, more-or-less, is just copy samples/standalone.yml to containers/app.yml and edit a bunch of stuff in response to your answers to a bunch of questions. You can do the same thing yourself – copy the file, edit to suit. It’s how all installs used to be done before @codinghorror decided he wanted to show he could write bash scripts with the best of 'em. :grinning:

(Rafael dos Santos Silva) #3

Just bear in mind that running on a different port that 80 and 443 isn’t really supported, and there will be some things broken.

If you really need to reuse the server you can set nginx in front to proxy request between discourse and he other site. There’s an #howto for that.

Starting a second Discourse forum on the same VPS
Installing Discourse With Plesk Onyx (Ubuntu 14.04)

Thank you for the answers!


what is it that actually isn’t working when using different ports? did it some months ago for a little test install and can’t see any issues …

now would have to do a more serious installation and am not sure if i should bother doing the nginx-proxy-thing or just change the ports as i did with the other…


(Rafael dos Santos Silva) #6

It breaks some parts, and since isn’t a priority for us (you can just use a reverse-proxy + subdomain or subfolder) we won’t be spending time to add support for this.


well, what are these parts? i still couldn’t uncover any…

and for me at least - on a plesk managed server where it’s a bit harder to see what’s actually happening behind the scenes - this reverse-proxying so far seems over my head… and from what i found so far most plesk related howtos and threads essentially end up using different ports as well… :roll_eyes:

(Jay Pfaffman) #8

That’s mostly unknown, but when you use a port and find out that it didn’t work, you’ll know. And then you can’t get help here, because it’s not supposed to work.

Your best bet is to install on a separate server.