{"id":17309065,"url":"https://github.com/martingabelmann/docker-owncloud","last_synced_at":"2025-07-12T19:32:25.639Z","repository":{"id":36937391,"uuid":"41244704","full_name":"martingabelmann/docker-owncloud","owner":"martingabelmann","description":"Dockerized owncloud, based on alpine","archived":false,"fork":false,"pushed_at":"2017-02-23T18:03:07.000Z","size":86,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"alpine","last_synced_at":"2025-03-28T02:53:17.393Z","etag":null,"topics":["docker","docker-owncloud","owncloud"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martingabelmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-23T10:05:26.000Z","updated_at":"2021-09-23T14:17:51.000Z","dependencies_parsed_at":"2022-07-08T15:51:36.536Z","dependency_job_id":null,"html_url":"https://github.com/martingabelmann/docker-owncloud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martingabelmann%2Fdocker-owncloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martingabelmann%2Fdocker-owncloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martingabelmann%2Fdocker-owncloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martingabelmann%2Fdocker-owncloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martingabelmann","download_url":"https://codeload.github.com/martingabelmann/docker-owncloud/tar.gz/refs/heads/alpine","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248891043,"owners_count":21178548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-owncloud","owncloud"],"created_at":"2024-10-15T12:07:49.197Z","updated_at":"2025-04-14T13:51:30.146Z","avatar_url":"https://github.com/martingabelmann.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OwnCloud with Docker\n_Based on Alpine_\n\n[![Run Status](https://api.shippable.com/projects/5787cdab3be4f4faa56ccc34/badge?branch=alpine)](https://app.shippable.com/projects/5787cdab3be4f4faa56ccc34)\n[![](https://images.microbadger.com/badges/image/martingabelmann/owncloud:alpine.svg)](http://microbadger.com/images/martingabelmann/owncloud:alpine \"Get your own image badge on microbadger.com\")\n[![](https://images.microbadger.com/badges/version/martingabelmann/owncloud:alpine.svg)](http://microbadger.com/images/martingabelmann/owncloud:alpine \"Get your own version badge on microbadger.com\")\n\n---\n\n * [Features](#features)\n * [Installation](#basics)\n * [Backups](#backups)\n * [Testing](#testing)\n * [OwnCloud cli](#owncloud-cli)\n\n#### Features\n - Full owncloud instance\n - OneClick/Run installation\n - Enforced ssl encryption \n - Backup cronjobs\n\n#### Installation\nGet the image:\n```\ndocker pull martingabelmann/owncloud\n```\n\nIt is highly recommended to use owncloud with SSL. The default Apache setting of this container forces the browser to use ``https://``. There are certificates build in the image for testing but in production you`ll have to use your own:\n\nAssuming you are owning (trusted) ssl-certificates at \n - ``/srv/docker/owncloud/ssl/server.key`` and \n - ``/srv/docker/owncloud/ssl/server.crt``,\n \nwhich belong to the domain ``example.org``,\n\nchoose a good database- and adminpassword, then type:\n  \n```\ndocker run --name=oc -d -p 443:443 -p 80:80 \\\n  -e DB_PASS=changemepls -e OC_ADMINPASS=changemepls \\\n  -e OC_DOMAIN=example.org -e OC_EMAIL=admin@example.org \\\n  -v /srv/docker/owncloud/:/owncloud/ martingabelmann/owncloud:alpine\n```\n\nThis will mount and use the certificates. Your {data,config,additional apps} are stored on your host at ``/srv/docker/owncloud/{data,config,apps}`` and the postgres database at ``/srv/docker/owncloud/sql``. \n\n\nCheck ``docker logs oc`` to verify that everything is done. Then point your browser to ``https://example.org/``. On the first vistit/install Owncloud will do some configurations and directly login into to the admin panel.\n\n##### Persistent configs\n**All** files locatet at ``/tpl`` are copied to the filesystems root ``/`` relative to ``/tpl/``. \nFor instance the preexisting file ``/tpl/etc/apache2/conf.d/httpd-vhosts.conf`` is copied to ``/etc/apache2/conf.d/httpd-vhosts.conf``.\nSimultaneously the installation uses the tool ``envsubst`` to replace all bash variables with variables passed with the ``-e`` option. \nFor php files this means, that you cannot simply write ``$phpvariable='\"$OC_DOMAIN\"';``, since the ``$phpvarvariable`` would be substituted too (with nothing if its not defined). \nThere is an exported variable ``${D}`` containing the dollar sign:  ``${D}phpvariable='\"$OC_DOMAIN\"';`` will lead to the desired result (e.g. ``$phpvariable='example.org';``).\n\nYou can mount your own config into ``/tpl`` and use your own environment variables with ``-e``.  \n  \n_Exception:_ the configs under ``/tpl/var/www/localhost/htdocs/config`` are only for new installs. For existing OwnCloud installations the files from ``/owncloud/config`` are used.\n\n#### Backups\nThe image provides a script called ``backup`` which is used to tar the data, config, apps and sql directories into OC_BACKUP_DIR and extract existing tarfiles from there into the corresponig destinations.\n\n##### Manual\n - You can either join the containers bash with a\n ```\n docker exec -ti oc bash\n ```\n and run the ``backup [options]``-command from there or run it directly from the host:\n ``` \n docker exec -ti oc backup [options]\n ```\n \n - To perform a new backup run ``backup -b``. The file is placed into ``/backups`` and called like ``owncloud_yearmonthday_time.tar.gz``. Depending on the variable ``OC_BACKUP_FILES``  (default=1), old backupfiles will be deleted.\n\n\n##### Automatic\nThe installscript is able to set a cronjob with that backup script. Because some people may have less storage it is disabled by default. To enable it just set the ``OC_BACKUP_CRON`` variable with the usual cron shurtcuts (see [here](http://fcron.free.fr/doc/en/fcrontab.5.html#AEN2144), e.g. to do a daily backup at midnight use \n``-e OC_BACKUP_CRON='@midnight'``).\n \n \n Full example to store the last 2 backups done at every midnight:\n\n```\ndocker run --name=oc -d -p 443:443 -p 80:80 \\\n  -e DB_PASS=changemepls -e OC_ADMINPASS=changemepls \\\n  -e OC_DOMAIN=example.org -e OC_EMAIL=admin@example.org \\\n  -e OC_BACKUP_FILES=2 \\\n  -e OC_BACKUP_CRON='@midnight' \\\n  -v /srv/backups/owncloud:/backups/ \\\n  -v /srv/docker/owncloud/:/owncloud martingabelmann/owncloud\n```\n \n##### Restore\n - Get a list of all available backups with ``backup -l``,\n - copy the filename of your choise (including extension),\n - restore with ``backup -r filename.tar.gz``\n\nHowever I can not give full warranty that restoring backups will work in every situation! It passed my daily usage but in some special configurations you may have to use a external backup service.\n\n#### Testing\nA minimal working owncloud instance can be run with\n\n```\ndocker run --name=octest -d -p 44300:443 -p 8000:80 martingabelmann/owncloud\n```\nThen point your browser to ``https://localhost:44300``. The container will use the build-in certificates, so be carefully, dont use this in public networks/production!\n\nDebuginformations can be viewed with\n```docker logs oc```\nor from inside the container (``docker exec -ti oc``) under ``/var/log/`` about apache, postgresql, cron and backups.\n\n\n#### Owncloud cli\n\nOwnCloud offers the possibility to do administrative tasks via the command line interface `occ`. Just try it\n```\ndocker exec oc occ help\n```\n\n\n#### Upgrades \n### OwnCloud\nThe used Owncloud instance is updated frequently due to the automated build (linked to alpine and the official owncloud image). Thus updates are performed by pulling the newest image, moving the running container and starting a new one. Since the apps arent effected they will be upgraded by the webinterface on the next visit or via the command line. \n  \nI recommend to upgrade via `occ`:\n```\ndocker exec oc occ upgrade\n```\n\nSometimes it happens that a upgrade fails and breaks your OwnCloud webinterface because a app isnt compatible (or so). Then you have to disable the app with \n```\ndocker exec oc occ app:disable APPNAME\n```\nyou may ask which apps are broken. Find out by observing `/var/www/localhost/htdocs/data/owncloud.log``. Check a specific app with\n\n```\ndocker exec oc app:check APPNAME\n``` \nfor compatiblity. If it fails, install the newest/compatible version by copying into `/var/www/localhost/htdocs/apps2/` (e.g. pulling from github). Afterwards try to enable it\n```\ndocker exec oc app:enable APPNAME\n```\nIf everything was successful you should be able to visit the webinterface again.\n\n### Postgresql\nUpgrading to major postgres versions in a docker environment [can be very painful](https://github.com/docker-library/postgres/issues/37). I recommend to spawn an alpine container from the previous image, run pg_dumpall and import the dump manually with the newer postgres.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartingabelmann%2Fdocker-owncloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartingabelmann%2Fdocker-owncloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartingabelmann%2Fdocker-owncloud/lists"}