docker.recipes

ownCloud

intermediate

File sync and share platform for enterprise.

Overview

ownCloud is an open-source file synchronization and sharing platform that enables organizations to maintain complete control over their data while providing Dropbox-like functionality. Originally founded in 2010 as a response to growing privacy concerns with cloud storage providers, ownCloud allows enterprises to host their own private cloud storage infrastructure, ensuring data sovereignty and compliance with strict regulatory requirements. The platform supports file versioning, collaborative editing, and extensive third-party integrations while maintaining enterprise-grade security features. This Docker stack combines ownCloud with MariaDB as the primary database backend and Redis for high-performance caching and session management. MariaDB provides robust data storage with its enhanced MySQL-compatible engine, offering better performance and additional features like the Aria storage engine for improved crash recovery. Redis accelerates the ownCloud experience by caching frequently accessed data, managing user sessions, and enabling real-time features through its sub-millisecond response times. This combination is ideal for organizations seeking a self-hosted alternative to commercial cloud storage solutions, particularly those in regulated industries like healthcare, finance, or government sectors where data locality and privacy are paramount. The stack scales effectively from small team deployments to enterprise installations supporting thousands of users, making it valuable for companies transitioning away from external cloud providers or establishing hybrid cloud strategies.

Key Features

  • File versioning and conflict resolution with automatic backup retention policies
  • External storage integration supporting FTP, SMB/CIFS, SharePoint, and object storage backends
  • MariaDB Aria storage engine providing crash-safe tables with better recovery capabilities
  • Redis-powered session clustering enabling horizontal scaling across multiple ownCloud instances
  • Built-in antivirus scanning integration with ClamAV for uploaded file security
  • LDAP and Active Directory authentication with group-based access controls
  • WebDAV protocol support for native desktop integration and third-party client compatibility
  • Federated sharing capabilities allowing secure file sharing between different ownCloud instances

Common Use Cases

  • 1Healthcare organizations needing HIPAA-compliant file storage with audit trails
  • 2Financial institutions requiring SOX compliance for document management and retention
  • 3Educational institutions providing secure file sharing for students and faculty
  • 4Government agencies maintaining data sovereignty while enabling remote collaboration
  • 5Law firms managing confidential client documents with granular access permissions
  • 6Manufacturing companies sharing CAD files and technical documentation across global teams
  • 7Small businesses replacing expensive enterprise storage solutions with self-hosted alternatives

Prerequisites

  • Minimum 2GB RAM (4GB+ recommended for production with multiple concurrent users)
  • Port 8080 available for web interface access
  • Basic understanding of file permission management and user access controls
  • SSL certificate and reverse proxy knowledge for production HTTPS deployment
  • Backup strategy planning for both database and file storage volumes
  • Network configuration knowledge for trusted domains and client synchronization

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 owncloud:
3 image: owncloud/server:latest
4 container_name: owncloud
5 restart: unless-stopped
6 environment:
7 OWNCLOUD_DOMAIN: localhost:8080
8 OWNCLOUD_TRUSTED_DOMAINS: localhost
9 OWNCLOUD_DB_TYPE: mysql
10 OWNCLOUD_DB_NAME: owncloud
11 OWNCLOUD_DB_USERNAME: owncloud
12 OWNCLOUD_DB_PASSWORD: ${DB_PASSWORD}
13 OWNCLOUD_DB_HOST: mariadb
14 OWNCLOUD_ADMIN_USERNAME: ${ADMIN_USER}
15 OWNCLOUD_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
16 OWNCLOUD_REDIS_ENABLED: true
17 OWNCLOUD_REDIS_HOST: redis
18 volumes:
19 - owncloud_data:/mnt/data
20 ports:
21 - "8080:8080"
22 depends_on:
23 - mariadb
24 - redis
25 networks:
26 - owncloud
27
28 mariadb:
29 image: mariadb:10.11
30 container_name: owncloud-mariadb
31 restart: unless-stopped
32 environment:
33 MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
34 MARIADB_DATABASE: owncloud
35 MARIADB_USER: owncloud
36 MARIADB_PASSWORD: ${DB_PASSWORD}
37 volumes:
38 - mariadb_data:/var/lib/mysql
39 networks:
40 - owncloud
41
42 redis:
43 image: redis:alpine
44 container_name: owncloud-redis
45 restart: unless-stopped
46 networks:
47 - owncloud
48
49volumes:
50 owncloud_data:
51 mariadb_data:
52
53networks:
54 owncloud:
55 driver: bridge

.env Template

.env
1DB_ROOT_PASSWORD=rootpassword
2DB_PASSWORD=owncloud
3ADMIN_USER=admin
4ADMIN_PASSWORD=changeme

Usage Notes

  1. 1Docs: https://doc.owncloud.com/
  2. 2Access at http://localhost:8080 - login with ADMIN_USER/PASSWORD
  3. 3Desktop sync clients: https://owncloud.com/desktop-app/
  4. 4Mobile apps for iOS and Android
  5. 5OWNCLOUD_TRUSTED_DOMAINS: add your domain for production
  6. 6Enterprise features: audit logs, workflows, Collabora integration

Individual Services(3 services)

Copy individual services to mix and match with your existing compose files.

owncloud
owncloud:
  image: owncloud/server:latest
  container_name: owncloud
  restart: unless-stopped
  environment:
    OWNCLOUD_DOMAIN: localhost:8080
    OWNCLOUD_TRUSTED_DOMAINS: localhost
    OWNCLOUD_DB_TYPE: mysql
    OWNCLOUD_DB_NAME: owncloud
    OWNCLOUD_DB_USERNAME: owncloud
    OWNCLOUD_DB_PASSWORD: ${DB_PASSWORD}
    OWNCLOUD_DB_HOST: mariadb
    OWNCLOUD_ADMIN_USERNAME: ${ADMIN_USER}
    OWNCLOUD_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
    OWNCLOUD_REDIS_ENABLED: true
    OWNCLOUD_REDIS_HOST: redis
  volumes:
    - owncloud_data:/mnt/data
  ports:
    - "8080:8080"
  depends_on:
    - mariadb
    - redis
  networks:
    - owncloud
mariadb
mariadb:
  image: mariadb:10.11
  container_name: owncloud-mariadb
  restart: unless-stopped
  environment:
    MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
    MARIADB_DATABASE: owncloud
    MARIADB_USER: owncloud
    MARIADB_PASSWORD: ${DB_PASSWORD}
  volumes:
    - mariadb_data:/var/lib/mysql
  networks:
    - owncloud
redis
redis:
  image: redis:alpine
  container_name: owncloud-redis
  restart: unless-stopped
  networks:
    - owncloud

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 owncloud:
5 image: owncloud/server:latest
6 container_name: owncloud
7 restart: unless-stopped
8 environment:
9 OWNCLOUD_DOMAIN: localhost:8080
10 OWNCLOUD_TRUSTED_DOMAINS: localhost
11 OWNCLOUD_DB_TYPE: mysql
12 OWNCLOUD_DB_NAME: owncloud
13 OWNCLOUD_DB_USERNAME: owncloud
14 OWNCLOUD_DB_PASSWORD: ${DB_PASSWORD}
15 OWNCLOUD_DB_HOST: mariadb
16 OWNCLOUD_ADMIN_USERNAME: ${ADMIN_USER}
17 OWNCLOUD_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
18 OWNCLOUD_REDIS_ENABLED: true
19 OWNCLOUD_REDIS_HOST: redis
20 volumes:
21 - owncloud_data:/mnt/data
22 ports:
23 - "8080:8080"
24 depends_on:
25 - mariadb
26 - redis
27 networks:
28 - owncloud
29
30 mariadb:
31 image: mariadb:10.11
32 container_name: owncloud-mariadb
33 restart: unless-stopped
34 environment:
35 MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
36 MARIADB_DATABASE: owncloud
37 MARIADB_USER: owncloud
38 MARIADB_PASSWORD: ${DB_PASSWORD}
39 volumes:
40 - mariadb_data:/var/lib/mysql
41 networks:
42 - owncloud
43
44 redis:
45 image: redis:alpine
46 container_name: owncloud-redis
47 restart: unless-stopped
48 networks:
49 - owncloud
50
51volumes:
52 owncloud_data:
53 mariadb_data:
54
55networks:
56 owncloud:
57 driver: bridge
58EOF
59
60# 2. Create the .env file
61cat > .env << 'EOF'
62DB_ROOT_PASSWORD=rootpassword
63DB_PASSWORD=owncloud
64ADMIN_USER=admin
65ADMIN_PASSWORD=changeme
66EOF
67
68# 3. Start the services
69docker compose up -d
70
71# 4. View logs
72docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/owncloud/run | bash

Troubleshooting

  • Database connection failed: Verify MariaDB container is running and DB_PASSWORD matches between services
  • Trusted domain error: Add your server's domain/IP to OWNCLOUD_TRUSTED_DOMAINS environment variable
  • File upload fails on large files: Increase PHP memory limit and upload size in ownCloud configuration
  • Desktop client sync issues: Check firewall settings and ensure WebDAV ports are accessible
  • Redis connection timeout: Verify Redis container health and network connectivity between services
  • Permission denied on file operations: Check owncloud_data volume permissions and container user mapping

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space