Mozilla’s Pocket is shutting down soon, so I need something else. In this post I explain the Readeck installation on Portainer with a SWAG reverse proxy in front.
Readeck container
I run readeck with the defaul sqlite database so there is no need to create use docker compose / a Portainer stack.
Readeck’s docker image is served by codeberg.org. In order to use it the registry needs to be added to Portainer under “Administration – Registry” as custom registry:

The following description is based on Readecks installation instructions which starts a single docker container:
# Do not run, just for reference!
$ docker run --rm -ti -p 8000:8000 -v readeck-data:/readeck codeberg.org/readeck/readeck:latest
The volume readdeck-data
needs to be created first:

Then a new container readeck
can be added under “containers – Add container” referencing the docker image codeberg.org/readeck/readeck:latest
:

Since there is a reverse-proxy in place we don’t need the port mapping.
Under “Advanced container settings” select the previously created volume and map it to /readeck
inside the container:

Assign the container to the network which SWAG is part of, e.g. proxynet
:

We use the default settings so there is no need to add environment variables.
After clicking on “deploy” the container should be started and shown in the state “running” in the list of containers.
SWAG configuration
At the time of writing there is no sample Readeck proxy configuration yet for SWAG. So create a new one manually e.g. at /portainer/Files/AppData/Config/swag/nginx/proxy-confs/readeck.subdomain.conf
:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name readeck.*;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
proxy_pass http://readeck:8000;
}
}
Finally the environment variables for the SWAG container need an update to reflect the subdomain so that certificates can be generated:
SUBDOMAINS=www,readeck
After a restart of the SWAG container Readeck should show up under the configured sub domain. Don’t forget to complete the onboarding / new user creation – or someone else will do it for you.
Backup
Backup is done on the docker host with borgmatic, running itself in a docker container. To actually create an backup file Readeck provides an readeck export
command. Create a helper script in the volume readeck-data
which is mounted in /readeck
inside the container, the path inside the container is /readeck/backup.sh
:
#!/bin/sh
set -e
mkdir -p /readeck/backups
rm -f /readeck/backups/backup.zip
readeck export -config /readeck/config.toml /readeck/backups/backup.zip
Don’t forget to set the executable bit on the script.
The last step is to configure the backup in borgmatic. The borgmatic container already mounts the host docker socker /var/run/docker.sock
, but the image only has minimal tools and no docker client itself. However the docker socket can also be used with plain curl and the docker API, e.g.:
curl --unix-socket /run/docker.sock http://localhost/v1.49/info
The compatible API version depends on the installed docker engine. As borgmatic is based on python we can use the installed python interpreted instead of errorprone shell scripting.
Place the script docker_socket_execute.py inside the borgmatic container at /etc/borgmatic.d
(usually mounted to either the host or to a volume) and give it executable permission.
Edit the borgmatic container to mount the readeck-data
volume readonly to e.g. /mnt/readeck-data
:

In the borgmatic configuration file add the directory /mnt/readeck-data/backups
and make sure the readeck backup script runs on the readeck
container just before a new backup is created:
source_directories:
- /mnt/readeck-data/backups
# ...
commands:
- before: everything
when:
- create
run:
- /etc/borgmatic.d/docker_socket_execute.py readeck /readeck/backup.sh
Finally run the backup and check if the file is included:
borgmatic list --archive latest --find backup.zip