.. /
                                                               .---.
                                                              /  .  \
                                                             |\_/|   |
                                                             |   |  /|
  .----------------------------------------------------------------' |
 /  .-.                                                              |
|  /   \     Setting up Nextcloud   (tested on Alpine)               |
| |\_.  |                                                            |
|\|  | /|    * preconfigured Apache web server                       |
| `---' |    * Docker volumes are used for persistent Nextcloud      |
|       |----                                 and database data ----'
\       |    * MariaDB runs in a separate container and is used as the database backend
 \     /     * The setup does not provide TLS/HTTPS encryption and is intended to run behind a reverse proxy
  `---'      * Redis runs in a separate container for caching and PHP sessions

  I'm assuming that you have working firewall since I open ports to all interfaces in this guide.


  source: https://github.com/nextcloud/docker/tree/master/.examples/docker-compose/insecure/mariadb/apache

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Make a directory and navigate to it

mkdir -p /opt/nextcloud
cd /opt/nextcloud

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Download compose.yaml and db.env

wget https://raw.githubusercontent.com/nextcloud/docker/refs/heads/master/.examples/docker-compose/insecure/mariadb/apache/compose.yaml

and

wget https://raw.githubusercontent.com/nextcloud/docker/refs/heads/master/.examples/docker-compose/insecure/mariadb/apache/db.env

or create them manually and copy the content from these links
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Remember to add a strong password after 'MYSQL_ROOT_PASSWORD=' in compose.yaml and 'MYSQL_PASSWORD=' in db.env. Make them different from each other.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
change the local ip adress to '8080:80' in compose.yaml

ports:
- 127.0.0.1:8080:80

change to

ports:
- 8080:80

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Run the command

docker compose up -d

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if everything went fine, check your server's ip adress:

ip a

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open your browser and type:

http://YourIpAdress:8080

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
set up your administration account and start using Nextcloud