1. Prepare the Server and Domain
Start from first steps on a new Linux server and install Docker. At your DNS provider, add an A record for the name you will use, such as cloud.example.com, with the server's IP address.
Ports: 443 for Nextcloud, 80 for its certificate, and 8080 for the AIO interface during setup. If you turned on the firewall on your server's page in the dashboard, allow 80 and 443 from anywhere and 8080 from your own address only. Docker's ports skip UFW, so the dashboard firewall is the one that counts here.
2. Start Nextcloud All-in-One
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 \ ghcr.io/nextcloud-releases/all-in-one:latest
Open https://203.0.113.10:8080 (your server's address) and accept the self-signed certificate warning, which is expected for this setup page. Note the passphrase AIO shows you: it is the only way back into this interface.
3. Enter Your Domain and Install
Enter cloud.example.com. AIO checks the domain points at the server, then lets you choose optional containers (office editing, Talk for video calls, full-text search) and your time zone. Start the containers and wait: the first start downloads several images and takes a few minutes. AIO then shows the admin username and password for Nextcloud itself.
4. Back Up to a Storage Box
In the AIO interface, open the backup section and choose a remote Borg repository. For a Virteche storage box:
ssh://[email protected]:23/./nextcloud-aio
AIO shows the SSH public key it connects with. Add it under SSH keys on the storage box's page in your dashboard, then run the first backup from AIO and set the daily backup time. Keep the backup encryption password AIO gives you somewhere other than the server: without it the backups cannot be restored.
The storage box's own scheduled snapshots add a copy that nothing connecting over SSH can change, which protects the backups if the Nextcloud server is ever compromised. See snapshots.
5. Connect Your Devices
Install the Nextcloud desktop app (Windows, macOS, Linux) and the phone app (iOS, Android), and sign in with https://cloud.example.com. Choose which folders to sync. The phone app can upload photos automatically, which replaces Google Photos or iCloud uploads for many people.
6. Keep It Updated
AIO updates Nextcloud and its containers from its own interface, and can do it automatically after each daily backup. Leave that on. The server underneath still needs its own security updates, which first steps on a new Linux server turns on.