- Clone this repository:
~$ git clone https://gitea.ddnss.de/dvdvgt/Docker-NextCloud-Gitea.git ~$ cd Docker-NextCloud-Gitea
- Create the neccassary environment files:
2.1 For *_db.env files add the following:
~$ touch nextcloud_app.env nextcloud_db.env gitea_app.env gitea_db.env
2.2 For *_app.env files add the following:MYSQL_DATABASE=CHANGEME MYSQL_USER=CHANGEME MYSQL_PASSWORD=CHANGEME MYSQL_ROOT_PASSWORD=CHANGEME
VIRTUAL_HOST=my.domain.com LETSENCRYPT_HOST=my.domain.com [email protected]
- Create the required directories:
3.1 Change to ownership of the directories and all files in it:
~# mkdir /media/storage/nextcloud ~# mkdir /media/storage/gitea
~# chown -R www-data:www-data /media/storage/nextcloud ~# chown -R www-data:www-data /media/storage/gitea
- Create new virtual docker network:
~# docker network create nginx-proxy
- Start up the containers in detached mode. Should you encounter any issue it might be a good idea to run it normally and not in detached mode to figure out the problem.
~# docker-compose up -d
Now that (hopefully) everything is running and has started up successfully you may now open NextCloud or Gitea via the virtual host your provided in the .env
files.
When first opening either Gitea or NextCloud you have to do the final setup. Select the MySQL database for both Gitea and Nextcloud and enter the credentials from the *_db.env files (not the root password though).
Now wait until it's done setting up and that's it. Enjoy!
The following software and images are used in this setup:
Name | URL | Description |
---|---|---|
Docker | https://docs.docker.com/install/ | Follow the instructions for installation. Note the convience script. |
Docker-Compose | https://docs.docker.com/compose/install/ | Follow the instructions for installation |
nginx-proxy | https://hub.docker.com/r/jwilder/nginx-proxy, https://github.com/nginx-proxy/nginx-proxy | Docker image |
nginx | https://hub.docker.com/_/nginx | Docker image |
nginx letsencrypt companion | https://hub.docker.com/r/jrcs/letsencrypt-nginx-proxy-companion | Docker image |
MariaDB | https://hub.docker.com/_/mariadb | MySQL Database Docker image for both NextCloud and Gitea |
Gitea | https://hub.docker.com/r/gitea/gitea, https://gitea.io/en-us/ | Docker image |
NextCloud | https://hub.docker.com/_/nextcloud | Docker image |