Themes: Data Ownership, Server
Status: đ±
Tags: resource
Nextcloud
Nextcloud is a self-hosted application for storing, syncing, and managing files, calendars, contacts, and other information. Its functionality can be expanded through additional apps and configuration.
- Open VSCode.
- Create a nextcloud folder and navigate into it.
mkdir nextcloud
cd nextcloud- Create a docker compose file.
nano docker-compose.yml- Nano will open an empty file in the main window of VS Code. Paste following the configuration into the this file, change the overwritecliurl to your domain, then save using CTRL or â + S.
services:
db:
image: mariadb:11.8
container_name: nextcloud-db
restart: unless-stopped
command:
- --transaction-isolation=READ-COMMITTED
- --binlog-format=ROW
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: nextcloud
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
volumes:
- ./mariadb:/var/lib/mysql
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:8-alpine
container_name: nextcloud-redis
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- ./redis:/data
app:
image: nextcloud:31-apache
container_name: nextcloud
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
ports:
- "${NEXTCLOUD_PORT}:80"
environment:
MYSQL_HOST: db
MYSQL_DATABASE: nextcloud
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
REDIS_HOST: redis
NEXTCLOUD_TRUSTED_DOMAINS: ${TRUSTED_DOMAINS}
OVERWRITECLIURL: ${OVERWRITECLIURL}
OVERWRITEPROTOCOL: https
PHP_MEMORY_LIMIT: 1G
PHP_UPLOAD_LIMIT: 16G
NEXTCLOUD_DEFAULT_PHONE_REGION: US
volumes:
- ./nextcloud:/var/www/html- Create a .env file.
nano .envCommand Breakdown
nano .envcreates a .env file used to define environment variables such as usernames, passwords, file locations, and domain names. Docker Compose uses these variables when reading the docker-compose.yml file.
- Nano will open an empty file in the main window of VS Code. Paste following the configuration into the this file, fill in the username, passwords, and trusted domains, save the login credentials to a password manager, then save using CTRL or â + S.
NEXTCLOUD_PORT=8080
DB_ROOT_PASSWORD=
DB_USER=
DB_PASSWORD=
TRUSTED_DOMAINS=nextcloud.domain.org
OVERWRITECLIURL=https://nextcloud.domain.org- Start the docker containers.
sudo docker compose up -d- Log into https://npm.domain.org
- Click âHostâ.
- Click âProxy Hostsâ.
- Click âAdd Proxy Hostâ and fill out the following:
- Domain Names: nextcloud.domain.org
- Scheme: http
- Forward Hostname / IP: serverâs IPv4
- Forward Port: 8080
- Enable âBlock Common Exploitsâ.
- Enable âWebsockets Supportâ.
- Click on âSSLâ .
- Select â*.domain.orgâ from the drop down.
- Enable all 4 options.
- Click âSaveâ.
- Record the port 8080 in the Server Administration note under Nextcloud.
Congratulations! The Server is Live
Check if everything is working
Back Matter
Next Step: Immich Installation
Previous Step: Actual Budget Installation
Parent Page: Home Server Build Guide