mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-02-23 21:36:19 +08:00
add documentation on how to run multiple AIO instances on the same server
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
63a74beeab
commit
fc01a07d38
3 changed files with 23 additions and 0 deletions
|
@ -6,6 +6,7 @@ You can run AIO with docker rootless by following the steps below.
|
|||
1. Install docker rootless by following the official documentation: https://docs.docker.com/engine/security/rootless/#install. The easiest way is installing it **Without packages** (`curl -fsSL https://get.docker.com/rootless | sh`). Further limitations, distribution specific hints, etc. are discussed on the same site. Also do not forget to enable the systemd service, which may not be enabled always by default. See https://docs.docker.com/engine/security/rootless/#usage. (`systemctl --user enable docker`)
|
||||
1. If you need ipv6 support, you should enable it by following https://docs.docker.com/config/daemon/ipv6/. The daemon.json file is most likely stored in `~/.config/docker/daemon.json`.
|
||||
1. Do not forget to set the mentioned environmental variables and in best case add them to your `~/.bashrc` file as shown!
|
||||
1. Also do not forget to run `loginctl enable-linger USERNAME` (and substitute USERNAME with the correct one) in order to make sure that user services are automatically started after every reboot.
|
||||
1. Expose the privileged ports by following https://docs.docker.com/engine/security/rootless/#exposing-privileged-ports. (`sudo setcap cap_net_bind_service=ep $(which rootlesskit); systemctl --user restart docker`)
|
||||
1. Use the official AIO startup command but use `--volume $XDG_RUNTIME_DIR/docker.sock:/var/run/docker.sock:ro` instead of `--volume /var/run/docker.sock:/var/run/docker.sock:ro` and also add `-e DOCKER_SOCKET_PATH=$XDG_RUNTIME_DIR/docker.sock` to the initial container startup (which is needed for mastercontainer updates to work correctly).
|
||||
1. Now everything should work like without docker rootless. You can consider using docker-compose for this or running it behind a reverse proxy. Basically the only thing that needs to be adjusted always in the startup command or docker-compose file (after installing docker rootles) are things that are mentioned in point 3.
|
||||
|
|
19
multiple-instances.md
Normal file
19
multiple-instances.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Multiple AIO instances
|
||||
It is possible to run multiple instances of AIO on one server.
|
||||
|
||||
There are two ways to achieve this: The normal way is creating multiple VMs, installing AIO in [reverse proxy mode](./reverse-proxy.md) in each of them and having one reverse proxy in front of them that points to each VM (you also need to use a different `TALK_PORT` for each of them). The second and more advanced way is creating multiple users on the server and using docker rootles for each of them in order to install multiple instances on the same server.
|
||||
|
||||
Below is described more in detail how the the second way works.
|
||||
|
||||
## Run multiple AIO instances on the same server with docker rootless
|
||||
1. Create as many linux users as you need first. The easiest way is to use `sudo adduser` and follow the setup for that. Make sure to create a strong unique password for each of them and write it down!
|
||||
1. Log in as each of the users e.g. by opening a new SSH connection and install docker rootles for each of them by following step 0-4 of the [docker rootles documentation](./docker-rootless.md).
|
||||
1. Then install AIO in reverse proxy mode by using the command that is descriebed in step 2 and 3 of the [reverse proxy documentation](./reverse-proxy.md) but use a different `APACHE_PORT` and `TALK_PORT` for each instance as otherwise it will bug out. Also make sure to adjust the docker socket and `DOCKER_SOCKET_PATH` correctly for each of them by following step 6 of the [docker rootless documentation](./docker-rootless.md). Additionally, modify `-p 8080:8080` to a different port for each container, e.g. `8081:8080` as otherwise it will not work.<br>
|
||||
**⚠️ Please note:** If you want to adjust the `NEXTCLOUD_DATADIR`, make sure to apply the correct permissions to the chosen path as documented at the bottom of the [docker rootless documentation](./docker-rootless.md). Also for the built-in backup to work, the target path needs to have the correct permissions as documented there, too.
|
||||
1. Now install your webserver of choice on the host system. It is recommended to use caddy for this as it is by far the easiest solution. You can do so by following https://caddyserver.com/docs/install#debian-ubuntu-raspbian or below. (It needs to be installed directly on the host or on a different server in the same network).
|
||||
1. Next create your Caddyfile with multiple entries and domains for the different instances like described in step 1 of the [reverse proxy documentation](./reverse-proxy.md). Obviously each domain needs to point correctly to the chosen `APACHE_PORT` that you've configured before. Then start Caddy which should automatically get the needed certificates for you if your domains are configured correctly and ports 80 and 443 are forwarded to your server.
|
||||
1. Now open each of the AIO interfaces by opening `https://ip.address.of.this.server:8080` or e.g. `https://ip.address.of.this.server:8081` or as chosen during step 3 of this documentation.
|
||||
1. Finally type in the domain that you've configured for each of the instances during step 5 of this documentation and you are done.
|
||||
1. Please also do not forget to open each chosen `TALK_PORT` UPD and TCP in your firewall/router as otherwise Talk will not work correctly!
|
||||
|
||||
Now everything should be set up correctly and you should have created multiple working instances of AIO on the same server!
|
|
@ -125,6 +125,9 @@ Simply run the following: `sudo docker exec -it nextcloud-aio-nextcloud php occ
|
|||
### How to resolve `Security & setup warnings displays the "missing default phone region" after initial install`?
|
||||
Simply run the following command: `sudo docker exec -it nextcloud-aio-nextcloud php occ config:system:set default_phone_region --value="yourvalue"`. Of course you need to modify `yourvalue` based on your location. Examples are `DE`, `EN` and `GB`. See this list for more codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
|
||||
|
||||
### How to run multiple AIO instances on one server?
|
||||
See [multiple-instances.md](./multiple-instances.md) for some documentation on this.
|
||||
|
||||
### Bruteforce protection FAQ
|
||||
Nextcloud features a built-in bruteforce protection which may get triggered and will block an ip-address or disable a user. You can unblock an ip-address by running `sudo docker exec -it nextcloud-aio-nextcloud php occ security:bruteforce:reset <ip-address>` and enable a disabled user by running `sudo docker exec -it nextcloud-aio-nextcloud php occ user:enable <name of user>`. See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#security for further information.
|
||||
|
||||
|
|
Loading…
Reference in a new issue