Arch Linux based Docker container including owncloud running on apache with sqlite, mariadb and php-xcache.
Any issues you encounter withthis image can be reported here:
https://github.com/l3iggs/docker-owncloud/issues
Say thanks by adding a comment here:
https://registry.hub.docker.com/u/l3iggs/owncloud/
- Install docker
- Download and start the owncloud server instance
docker run --name oc -p 80:80 -p 443:443 -d l3iggs/owncloud
- Access the docker setup page
Point your browser to:
http://localhost/owncloud
or
https://localhost/owncloud
and follow the on-onscreen instructions to finish the owncloud server setup. - [Optional] Change your owncloud data storage location
On the Owncloud initial setup page, after setting up your admin account, instead of clicking the "Finish Setup" button, you can click "Storage & database" instead. You can change the data folder location here (note that this is a path inside the docker container, not on your host machine).
It's likely desirable for owncloud's data storage to be placed in a persistant storage location outside the docker container, on the host's file system for example. Let's imagine you wish to store your docker files in a folder~/ocfiles
on the host's file system. Then insert the following into the docker startup command (from step 2. above) betweenrun
and--name
:
-v ~/ocfiles:/usr/share/webapps/owncloud/data
UID 33 or GID 33 (http in the container image) must have r/w permissions for~/ocfiles
on the host system. Generally, it's enough to do:
chmod -R 770 ~/ocfiles; sudo chgrp -R 33 ~/ocfiles
Read this if you run into permissions issues in the container. - [Optional] Change your owncloud config storage location
Similar to the above change, this allows the owncloud config directory to be stored outside of the docker container.
-v ~/occonfig:/etc/webapps/owncloud/config
chmod -R g+rw ~/occonfig; sudo chgrp -R 33 ~/occonfig
- [Optional] Setup owncloud to use mariadb instead of the default sqlite database
On the Owncloud initial setup page, after setting up your admin account, instead of clicking the "Finish Setup" button, you can click "Storage & database" instead. Then click the "MySQL/MariaDB" enter 'root' in the Database user field and leave the password field blank. Choose any name you like for the Database name field. The Database host filed should be left as 'localhost' if you'd like to use the mariadb server provided in this docker image. - [Optional] Use your own ssl certificate
This image comes with a self-generated ssl certificate and so you'll get browser warnings when you access owncloud via https. You can replace these self signed certificates with your own, properly generated cert files. Assuming you haveserver.crt
andserver.key
files in a directory~/sslCert
on the host machine:
sudo chown -R root ~/sslCert; sudo chgrp -R root ~/sslCert
sudo chmod 400 ~/sslCert/server.key
You can then add-v ~/sslCert:/https
to the docker run command line to use your ssl certificate files. - [Optional] Stop the docker-owncloud server instance
docker stop oc
- [Optional] Delete the docker-owncloud server instance (after stopping it)
docker rm oc
- Profit.