← Tous les guides
Nextcloud (Docker)
A free, open-source, self-hosted file sync/share and collaboration platform -- your own private alternative to Google Drive/Dropbox, run via the official Docker image.
Ce guide est élaboré à partir de la documentation officielle de Nextcloud (Docker), dont le lien figure ci-dessus — vérifiez toujours les noms exacts des paquets/versions avant d'exécuter ces commandes sur un serveur de production, car les versions de la distribution et du projet évoluent avec le temps.
1Create a Docker Compose file
Nextcloud needs a database -- this compose file runs it alongside MariaDB, both with persistent volumes.
cat > docker-compose.yml <<'EOF' services: db: image: mariadb:11 restart: unless-stopped environment: MYSQL_ROOT_PASSWORD: changeme-root MYSQL_DATABASE: nextcloud MYSQL_USER: nextcloud MYSQL_PASSWORD: changeme-db volumes: - db_data:/var/lib/mysql app: image: nextcloud:latest restart: unless-stopped ports: - "8080:80" environment: MYSQL_HOST: db MYSQL_DATABASE: nextcloud MYSQL_USER: nextcloud MYSQL_PASSWORD: changeme-db volumes: - nc_data:/var/www/html depends_on: - db volumes: db_data: nc_data: EOFReplace changeme-root and changeme-db with real passwords before starting -- these are written into the running containers' environment.
2Start it
docker compose up -d3Complete the setup wizard
Create the admin account on first visit -- the database connection is already configured via the environment variables above.
http://<the-server's-ip>:80804Put it behind a reverse proxy with HTTPS before real use
Nextcloud syncs files and credentials -- don't leave it on plain HTTP for anything beyond local testing. See the Nginx + Let's Encrypt guide in this section.