{"id":29826640,"url":"https://github.com/infinityofspace/kopia_rclone_docker","last_synced_at":"2025-08-26T19:25:26.619Z","repository":{"id":40475621,"uuid":"396773086","full_name":"infinityofspace/kopia_rclone_docker","owner":"infinityofspace","description":"Docker image with kopia and rclone","archived":false,"fork":false,"pushed_at":"2025-08-17T20:21:25.000Z","size":83,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-17T22:13:11.017Z","etag":null,"topics":["backup","docker","docker-image","kopia","rclone"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infinityofspace.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-16T11:56:18.000Z","updated_at":"2025-08-17T20:20:49.000Z","dependencies_parsed_at":"2024-04-16T19:39:56.084Z","dependency_job_id":"75519b59-73eb-4a18-b204-d81dd5048991","html_url":"https://github.com/infinityofspace/kopia_rclone_docker","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/infinityofspace/kopia_rclone_docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fkopia_rclone_docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fkopia_rclone_docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fkopia_rclone_docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fkopia_rclone_docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinityofspace","download_url":"https://codeload.github.com/infinityofspace/kopia_rclone_docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fkopia_rclone_docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272248898,"owners_count":24899881,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backup","docker","docker-image","kopia","rclone"],"created_at":"2025-07-29T05:11:16.507Z","updated_at":"2025-08-26T19:25:26.611Z","avatar_url":"https://github.com/infinityofspace.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kopia + rclone Docker image\n\nDocker image with kopia and rclone\n\n---\n\n[![release build](https://github.com/infinityofspace/kopia_rclone_docker/actions/workflows/docker-publish-release.yml/badge.svg)](https://github.com/infinityofspace/kopia_rclone_docker/actions/workflows/docker-publish-release.yml)\n[![weekly build](https://github.com/infinityofspace/kopia_rclone_docker/actions/workflows/docker-publish-weekly.yml/badge.svg)](https://github.com/infinityofspace/kopia_rclone_docker/actions/workflows/docker-publish-weekly.yml)\n[![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/infinityofspace/kopia_rclone_docker?include_prereleases\u0026label=lastest%20version\u0026style=plastic)](https://github.com/infinityofspace/kopia_rclone_docker/releases)\n\n---\n\n### Table of Contents\n\n1. [About](#about)\n2. [Versions](#versions)\n    1. [Supported architectures](#supported-architectures)\n3. [Usage](#usage)\n    1. [Examples](#examples)\n4. [Build locally](#build-locally)\n5. [Third party notices](#third-party-notices)\n6. [License](#license)\n\n---\n\n## About\n\nThis docker image contains kopia and rclone build from source which can be used out of the box.\n[kopia](https://github.com/kopia/kopia) is an open source backup tool with other useful features such as encryption,\ndeduplication and compression. It has a [rclone](https://github.com/rclone/rclone) integration for storing the backups\nin one of the cloud storage systems supported by rclone.\n\n## Versions\n\nYou can find detailed information about the supported versions of kopia and rclone in\nthe [versions' wiki](https://github.com/infinityofspace/kopia_rclone_docker/wiki/versions).\n\n## Usage\n\nYou can pull the latest version of the image with this command:\n\n```commandline\ndocker pull ghcr.io/infinityofspace/kopia_rclone_docker:latest\n```\n\nTo use rclone, you must first create a configuration of the storage system to be used. The rclone configuration is in\nthe `/rclone` path. If you have not already created an rclone configuration for the desired storage system you can use\nthe following command and follow the rclone instructions to create such configuration:\n\n```commandline\ndocker run \\\n    -v $(pwd)/rclone:/rclone \\\n    ghcr.io/infinityofspace/kopia_rclone_docker:latest \\\n        rclone config\n```\n\nThe usage of rclone can be found in the [official documentation](https://rclone.org/docs/).\n\nNow we use the rclone storage system configuration for kopia. You can use the kopia commands as normal:\n\n```commandline\ndocker run \\\n    -v $(pwd)/rclone:/rclone \\\n    ghcr.io/infinityofspace/kopia_rclone_docker:latest \\\n        kopia --version\n```\n\nYou can also put all the kopia commands into a shell script and then run them in the docker container at startup (here\nthe `kopia_cmds.sh ` file contains all the commands, make sure the file is executable). Moreover, you can specify the\nkopia password with the `KOPIA_PASSWORD` environment variable:\n\n```commandline\ndocker run \\\n    -v $(pwd)/rclone:/rclone \\\n    -v $(pwd)/kopia_cmds.sh:/kopia_cmds.sh \\\n    -e KOPIA_PASSWORD=mysecretpassword \\\n    ghcr.io/infinityofspace/kopia_rclone_docker:latest \\\n        /kopia_cmds.sh\n```\n\nTo store the kopia configuration independently of a docker container you can use docker volumes. The kopia configuration\nis in the `/kopia/config` path and the kopia cache is in `/kopia/cache`. Here we store the kopia configuration and data\ncache in docker volumes:\n\n```commandline\ndocker run \\\n    -v $(pwd)/rclone:/rclone \\\n    -v kopia_config:/kopia/config \\\n    -v kopia_cache:/kopia/cache \\\n    -e KOPIA_PASSWORD=mysecretpassword \\\n    ghcr.io/infinityofspace/kopia_rclone_docker:latest \\\n        kopia repository create rclone \\\n        --remote-path testcloud:/path/to/the/backup/dir\n```\n\nThe following environment variables are defined for the docker image:\n\n- KOPIA_CONFIG_PATH=/kopia/config/repository.config\n- KOPIA_LOG_DIR=/kopia/logs\n- KOPIA_CACHE_DIRECTORY=/kopia/cache\n- RCLONE_CONFIG=/rclone/rclone.conf\n- KOPIA_CHECK_FOR_UPDATES=false\n\nYou can override them if you want to adjust the paths or values.\n\nThe official usage documentation of kopia can be found [here](https://kopia.io/docs/).\n\n### Examples\n\nrclone or kopia can be used as usual. In the examples, we assume that we already have a valid rclone configuration in\nthe current working directory. Some examples are listed below:\n\n#### rclone\n\nGet quota information of the remote `mycloud`:\n\n```commandline\ndocker run \\\n    -v $(pwd)/rclone:/rclone \\\n    ghcr.io/infinityofspace/kopia_rclone_docker:latest \\\n        rclone about mycloud:\n```\n\nList all content in the path `/backups` on the remote `mycloud`:\n\n```commandline\ndocker run \\\n    -v $(pwd)/rclone:/rclone \\\n    ghcr.io/infinityofspace/kopia_rclone_docker:latest \\\n        rclone ls mycloud:/backups\n```\n\nShow the version number of rclone:\n\n```commandline\ndocker run \\\n    -v $(pwd)/rclone:/rclone \\\n    ghcr.io/infinityofspace/kopia_rclone_docker:latest \\\n        rclone version\n```\n\n#### kopia\n\nInitialise a new kopia repository in the remote path `/backup/data` on the remote `mycloud`. Additionally, the password\nused to encrypt the repo data is `mysecretpassword` and the kopia configuration respectively cache is written to the\nDocker volumes `kopia_config` and `kopia_cache`:\n\n```commandline\ndocker run \\\n    -v $(pwd)/rclone:/rclone \\\n    -v kopia_config:/kopia/config \\\n    -v kopia_cache:/kopia/cache \\\n    -e KOPIA_PASSWORD=mysecretpassword \\\n    ghcr.io/infinityofspace/kopia_rclone_docker:latest \\\n        kopia repository create rclone \\\n        --remote-path mycloud:/backup/data\n```\n\nConnect to an existing kopia repository in the remote path `/backup/data` on the remote `mycloud`. Additionally, the\npassword used to encrypt the repo data is `mysecretpassword` and the kopia configuration respectively cache is written\nto the Docker volumes `kopia_config` and `kopia_cache`:\n\n```commandline\ndocker run \\\n    -v $(pwd)/rclone:/rclone \\\n    -v kopia_config:/kopia/config \\\n    -v kopia_cache:/kopia/cache \\\n    -e KOPIA_PASSWORD=mysecretpassword \\\n    ghcr.io/infinityofspace/kopia_rclone_docker:latest \\\n        kopia repository connect rclone \\\n        --remote-path mycloud:/backup/data\n```\n\nSet the `global` policy for the number of kept annual snapshot of the currently connected repo to `12`, where the\ncurrently connected repo is stored in the docker volume kopia_config:\n\n```commandline\ndocker run \\\n    -v $(pwd)/rclone:/rclone \\\n    -v kopia_config:/kopia/config \\\n    -v kopia_cache:/kopia/cache \\\n    -e KOPIA_PASSWORD=mysecretpassword \\\n    ghcr.io/infinityofspace/kopia_rclone_docker:latest \\\n      kopia \\\n      policy \\\n      set \\\n      --global \\\n      --keep-annual 12\n```\n\n#### Backup Docker volumes\n\nThe following example describes the backup of any Docker volume.\nAdvantages of the backup with kopia and rclone:\n- end to end encrypted backup\n- duplicate the backup with kopia repository [synchronization](https://kopia.io/docs/advanced/synchronization/)\n- incremental backups\n- send backup to remote storage (this means that if local storage space is limited, complete backups that require more storage than is available locally are still possible)\n\n#### Docker standalone\n\nThe following example describes the backup of a Docker volume with kopia and rclone in a standalone Docker installation.\n\nBefore we get started, we need to customise the image. We need to add `docker-cli` to the base image, which we need to interact with the Docker socket.\nFor this purpose, create the file `Dockerfile` with the following content:\n```Dockerfile\nFROM ghcr.io/infinityofspace/kopia_rclone_docker:latest\n\nRUN apk add --no-cache docker-cli\n```\n\nIn the next step, create the `docker-compose.yml` file with the following content:\n```docker-compose\nservices:\n    kopia:\n      build: .\n      restart: unless-stopped\n      ports:\n          - 127.0.0.1:8080:8080\n      environment:\n          - KOPIA_PERSIST_CREDENTIALS_ON_CONNECT=true\n      volumes:\n          - kopia_config:/kopia/config\n          - kopia_logs:/kopia/logs\n\n          # rclone config folder\n          - ./rclone_config:/rclone\n          # custom docker container shutdown and startup scripts folder\n          - ./scripts:/scripts\n\n          # rootless docker socket location\n          - \"$XDG_RUNTIME_DIR/docker.sock:/var/run/docker.sock\"\n          # uncomment the next line when you use a rootfull docker socket location\n          # - /var/run/docker.sock:/var/run/docker.sock\n\n          # all volumes which should be backed up\n          - volume1:/volumes/volume1:ro\n        command:\n          - kopia\n          - server\n          - start\n          - --insecure\n          - --address=0.0.0.0:8080\n          - --server-username=${USER}\n          - --server-password=${KOPIA_PASSWORD}\nvolumes:\n    kopia_config:\n    kopia_logs:\n    volume1:\n        external: true\n```\n\nThe service `kopia` is defined in the docker compose file, which offers a web UI for creating and managing backups.\nThis Web UI can be accessed at the address `http://localhost:8080`.\n\nHowever, before you start the docker compose service, you must first create scripts for the shutdown and start docker container that use the desired volume.\nCreate the container shutdown and restart scripts in a folder called `scripts` next to the docker compose file (the name of the container is in this example `container_service1`):\n\nShutdown script:\n```bash\n#!/bin/sh\n\ndocker stop $1\n```\nStart script:\n```bash\n#!/bin/sh\n\ndocker start $1\n```\n\nSavethe shutdown and start scripts in the `scripts` folder.\nAfter you have created the scripts, you still have to make them executable. This is possible under common Unix systems with this command:\n```commandline\nchmod -x scripts/*\n```\n\nThe last preparation step is to define the kopia user and password. This is done using the following `.env` file:\n```\nUSER=\nKOPIA_PASSWORD=\n```\n\nFinally, start the kopia docker service with the command:\n```commandline\ndocker compose up -d\n```\n\n---\n\nNow open the address `http://localhost:8080` of the Web UI in a web browser. At the first start, set up the kopia repository and select `rclone` as the provider.\nAlso make sure the config file is set to `/kopia/config/repository.config`. In the next step, we set up the backup of volume `volume1` by entering the path `/volumes/volume1` of\nvolume `volume1` of the container under the menu item `Policies` in the input field `enter directory to find or set policy` and creating the policy with the button `Set Policy`.\nTo stop the container in the backup process so that no unstable data state of the backup occurs, we must now set up the shutdown and start scripts in the previously\ncreated policy. To do this, use the `Edit` button of the corresponding policy in the `Policies` menu item. Now enter the script path `shutdown.sh` with the contains names as arguments in\nthe `Before Snapshot` entry of the `Snapshot Action` menu. For the entry `After Snapshot` enter `start.sh` with the contains names as arguments and save the policy with the `Save Policy` button.\n\nAt this point, the Docker volume `volume1` can be backed up. Ideally, set up a scheduled backup in the policy for the path so that a backup is performed automatically.\n\n## Build locally\n\nBefore you create the image you must first clone the repo:\n\n```commandline\ngit clone https://github.com/infinityofspace/kopia_rclone_docker.git\n```\n\nChange the current working directory:\n\n```commandline\ncd kopia_rclone_docker\n```\n\nYou can build the image yourself locally instead of using the prebuild image. Use the following command to build the\ndocker image with a full kopia server version. This version includes the web gui and is built directly from the\n`master` branches of kopia and rclone:\n\n```commandline\ndocker build -t kopia_rclone_docker .\n```\n\nIf you don't need the web gui of kopia server, then you can specify this with the build argument `KOPIA_BUILD_TYPE=noui`\nand kopia will be built without the web gui:\n\n```commandline\ndocker build \\\n    --build-arg KOPIA_BUILD_TYPE=noui \\\n    -t kopia_rclone_docker \\\n    .\n```\n\nIf you want to use a specific version of kopia or rlcone for the image build, you can do this with the environment\nvariables `RCLONE_BRANCH` and `KOPIA_BRANCH` respectively:\n\n```commandline\ndocker build \\\n    --build-arg KOPIA_BUILD_TYPE=noui \\\n    --build-arg RCLONE_BRANCH=v1.56.0 \\\n    --build-arg KOPIA_BRANCH=v0.8.4 \\\n    -t kopia_rclone_docker \\\n    .\n```\n\n## Third party notices\n\nThis project uses source code with different licenses, these are listed in the following:\n\n- rclone:\n    - [link to project](https://github.com/rclone/rclone)\n    - [link to license](https://raw.githubusercontent.com/rclone/rclone/master/COPYING)\n- kopia:\n    - [link to project](https://github.com/kopia/kopia)\n    - [link to license](https://raw.githubusercontent.com/kopia/kopia/master/LICENSE)\n\nBy using this docker image, you agree to the listed licenses.\n\n## License\n\n[MIT](License) - Copyright (c) 2021 Marvin Heptner\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinityofspace%2Fkopia_rclone_docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinityofspace%2Fkopia_rclone_docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinityofspace%2Fkopia_rclone_docker/lists"}