4 minutes
Self-hosted Wallabag using Docker
To keep track of articles I want to read, my tool of choice was wallabag. This tool offers a nice way of saving an article’s content and providing a custom view to read those “offline”. And by “offline” I mean online, but on my wallabag instance and not on the author’s site. Another big advantage is to avoid annoying advertisement on the article’s homepage. I’m using it as a self-hosted alternative to Pocket.
On Docker Hub, a comprehensive documentation is provided, explaining how to install and configure wallabag running in a Docker container. Like my other websites running in Docker, I wanted to access wallabag via an encrypted HTTPS connection using Traefik as a reverse proxy.
My running instance of wallabag consists of three Docker container specified as services in a docker-compose.yml file:
- Wallabag
- SMTP
- Web server
1. Wallabag
Based on wallabag’s official Docker image I changed only two environment variables (line 6 and 7) and added two volumes (line 13 and 14). Line 14 enables saving wallabag’s SQLite database outside the container.
|
|
I chose SMTP to send mails from wallabag and therefore needed an SMTP service. It is by far not the best option, but it works. And it is just for sending a single mail per registered user, so in my case just one mail.
2. SMTP
For wallabag’s initial registration process, a mail containing an opt-in link needs to be sent. To be able to send messages, I added a second Docker container running an SMTP server. This container is only reachable from within Docker’s private network. So it is not available for the outside world.
|
|
This sets up a dedicated SMTP server. It is not the best idea because it is not too hard getting blacklisted. For example mailbox.org, my mail provider, is filtering my mails and Gmail is not. But I’m just sending a single registration mail, which justifies this solution in my eyes.
3. Web server
Only the web server, that is required to run wallabag, is known to Traefik but still only reachable from Docker itself.
|
|
As you can see in line 7, I’m providing a read-only nginx configuration file. I have to admit that this configuration file results from a try-and-error session. The problem I had to tackle was to let wallabag work together with Traefik as a reverse proxy and its forwarded HTTP requests.
|
|
Summary
Getting wallabag to run in a Docker container was not that easy. The first problem was to find a working nginx configuration. I am no web server expert and had almost no experience with nginx. That’s why it took quite some time to find and set the correct parameters.
As soon as wallabag was up and running, I was quite happy and started saving articles. At this time, I had a MySQL container running and assumed to have it connected to wallabag. But that was not the case, as I noticed later on. All my data was gone, user account as well as saved articles. So I started again, but was not able to have a proper connection. That’s why I am now just saving wallabag’s default SQLite database outside the container.