[DOCKER] Installing Nextcloud on different ports reddit / selfhosted ---------------------------------------------------------------------- Holiday-Advance-7524 · 2023-09-27 14:39 Hi there. Im currently trying to install Nextcloud in a dedi machine where I already have a nginx server registered to port 80. the install instructions says to use the following commandline: >!\# For Linux and without a web server or reverse proxy (like Apache, Nginx, Cloudflare Tunnel and else) already in place:!!sudo docker run \\!!\--init \\!!\--sig-proxy=false \\!!\--name nextcloud-aio- mastercontainer \\!!\--restart always \\!!\--publish 80:80 \\!!\--publish 8080:8080 \\!!\--publish 8443:8443 \\!!\--volume nextcloud\_aio\_mastercontainer:/mnt/docker-aio-config \\!!\--volume /var/run/docker.sock:/var/run/docker.sock:ro \\!!nextcloud/all-in- one:latest!!\--publish 80:80 \\!!\--publish 8080:8080 \\!!\--publish 85:80 \\!!\--publish 8085:8080 \\!< Or do I need to take any additional step to get this working as I get the following error when pasting the "default" commandline docker: Error response from daemon: Conflict. The container name "/nextcloud-aio-mastercontainer" is already in use by container "49f3aa49ab13b63e2798f5a2e79168170db784861f2b0ac098b7dfd36df651c9". You have to remove (or rename) that container to be able to reuse that name. See 'docker run --help'. ---------------------------------------------------------------------- Holiday-Advance-7524 · 2023-09-27 14:40 Link to the docs: https://github.com/nextcloud/all-in-one#how-to-use- this ---------------------------------------------------------------------- geo38 · 2023-09-27 15:59 "The container name "/nextcloud-aio-mastercontainer" is already in use by container" has nothing to do with ports. From some previous attempt, you have a container lying round with the same name. docker rm -f 49f3aa49ab13b63e2798f5a2e79168170db784861f2b0ac098b7dfd36df651c9 Now try with your changed port mappings also, /r/docker is a great place for docker questions. ---------------------------------------------------------------------- Holiday-Advance-7524 · 2023-09-27 16:18 I copied the wrong error lol. I got an error mentioning a port already in use. It seems that if I apply different ports it works fine. Tho I'm also trying to install NginxProxyManager. Changing the port here seems to work as well tho I get an issue with the port 443. Can I change this port as well or do I have to change other things? As far as I understand that port is related to SSL no? Do correct me if I'm wrong. I'm quite new to this ---------------------------------------------------------------------- szaimen · 2023-09-27 17:49 Hi u/Holiday-Advance-7524 can you follow https://github.com/nextcloud/all-in-one/blob/main/reverse- proxy.md#6-how-to-debug-things? ---------------------------------------------------------------------- rockypanther · 2023-09-27 17:53 If you are using a reverse proxy then ports 80 and 443 are typically used by that reverse proxy which is the intended behaviour. Reverse proxy would listen to incoming requests and route it to the application's port. In your case, just let nextcloud run on a different port (let's say 5566) and point your reverse proxy to Nextcloud's port. Also, a personal opinion - I find Traefik is much more polished to work with docker than Nginx. Just my personal opinion though, Nginx is also great in its own place. ---------------------------------------------------------------------- Holiday-Advance-7524 · 2023-09-27 18:40 If i want to change the ports from their defaults. Which part in the image [here](https://i.imgur.com/0xRXTA9.png) should I be changing? \# These ports are in format : \- '80:80' # Public HTTP Port \- '443:443' # Public HTTPS Port \- '81:81' # Admin Web Port in the case of the above configuration. If i want the admin panel to be set for port 324 for example. Do i change it to 324:324 or should i leave one of them as 81? Im very new to this lol ---------------------------------------------------------------------- rockypanther · 2023-09-27 19:06 It really depends upon your setup and needs. So before answering your question I would point you to [docker networks overview](https://docs.docker.com/network/) to learn more on how : config works - which is really important to understand when working with multiple docker images. Now to your question about admin panel, \- If you do 324:324, ports on docker's internal network and host network would be same 324. \- If you want docker's internal network port to remain 81 and only want to change the port that is expose to your host (your PC I am assuming), then you can do 324:81 \- You can also do other way around as well. (i.e. 81:324) if you want to expose port 81 to your local machine. \- You can choose not to expose any port at all to the host machine by removing ":" and just write the port you want. This will stop exposing any port to your host network and app can still communicate within docker's network on the port specified. (This is recommended scenario when using reverse proxy as another docker container which is on a same docker network. Reverse proxy itself exposes port 80 and 443 to host network and that's enough to listen to HTTP and HTTPS requests from host machine. Then its up to the reverse proxy to route the request to the designated container which is within its docker network.) I would really encourage you to read through docker documentation get a grasp of this. ---------------------------------------------------------------------- arcadianarcadian · 2023-09-28 21:35 docker rm nextcloud-aio-mastercontainer then run your command.