Skip to content

Setup ownCloud to use containerized PostgreSQL (MariaDB, MySQL)

Cema edited this page Jul 16, 2015 · 3 revisions

Using PostgreSQL/MariaDB/MySQL as database for ownCloud have a lot of benefits. Before running owncloud container, pull and run official PostgreSQL image:

docker pull postgres
docker run --name=postgres -e POSTGRES_PASSWORD=supersecretpassword \
  -d postgres

You can save PostgreSQL data out of container by running:

mkdir /opt/pg_data
docker run --name=postgres -e POSTGRES_PASSWORD=supersecretpassword \
  -v /opt/pg_data:/var/lib/postgresql/data \
  -d postgres

Then run owncloud linked to postgres container:

docker run --name oc -p 80:80 -p 443:443 --link=postgres \
  -d l3iggs/owncloud

Then, on the ownCloud initial setup page, after setting up your admin login and password, instead of clicking the "Finish Setup" button, click "Storage & database".
Then click the "PostgreSQL" and enter:

  • login: postgres
  • password: supersecretpassword
  • db: any name you like
  • hostname: postgres

By following these steps with official MariaDB image or MySQL image you can easily configure ownCloud to use them.