Introduction
Wallabag is a self-hosted read-it-later application that allows users to save web articles for offline reading. If youโre a developer or homelabber looking to maintain your privacy while managing bookmarks, self-hosting Wallabag on a Virtual Private Server (VPS) can be an excellent solution. This guide will walk you through the steps to install Wallabag on a VPS.
Choosing Your VPS Provider
Before diving into the installation, choose a reliable VPS provider. Hereโs a comparison of some of the popular options available:
| Provider | Price (Monthly) | Storage | RAM | CPU |
|---|---|---|---|---|
| Contabo VPS | 5.99 EUR | 100 GB | 4 GB | 2 |
| Hetzner Cloud | 4.15 EUR | 20 GB | 2 GB | 1 |
| DigitalOcean | 6 USD | 25 GB | 1 GB | 1 |
| Vultr | 6 USD | 25 GB | 1 GB | 1 |
| Linode (Akamai) | 5 USD | 25 GB | 2 GB | 1 |
For a lightweight application like Wallabag, the VPS should have at least 2 GB of RAM and enough storage for saved articles.
Recommended Provider: Hetzner Cloud
Considering the low cost and adequate resources, Hetzner Cloud is an excellent choice for hosting Wallabag. You can sign up for Hetzner Cloud here.
Prerequisites
- VPS Setup: Create an account with your chosen provider and set up a VPS instance with Ubuntu 20.04.
- SSH Access: Ensure you can connect to your VPS via SSH. Use tools like PuTTY or the command line to access your server.
- Domain Name (optional): For easier access, consider purchasing a domain name and pointing it to your VPS IP address.
Installing Dependencies
Before installing Wallabag, you need to install some dependencies.
sudo apt update
sudo apt install -y curl git unzip nginx php-fpm php-mysql php-xml php-mbstring php-zip php-curl php-gd
These packages include Nginx as the web server and PHP along with necessary extensions.
Downloading and Installing Wallabag
- Clone Wallabag:
cd /var/www
sudo git clone https://github.com/wallabag/wallabag.git
cd wallabag
- Set Permissions:
Set appropriate permissions for Wallabag to function correctly:
sudo chown -R www-data:www-data /var/www/wallabag
- Install Composer:
Composer is necessary for managing PHP dependencies.
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
- Install Wallabagโs PHP Dependencies:
Navigate to the Wallabag directory and install the required PHP packages:
composer install --no-dev
Configuring Nginx
Add a new Nginx configuration for Wallabag:
sudo nano /etc/nginx/sites-available/wallabag
Insert the following configuration:
server {
listen 80;
server_name your_domain_or_IP;
root /var/www/wallabag/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Make sure to replace your_domain_or_IP with your actual domain or VPS IP.
Enable the new site and test your Nginx configuration:
sudo ln -s /etc/nginx/sites-available/wallabag /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
Configuring Database
- Install MySQL:
sudo apt install mysql-server
- Create the Wallabag Database:
sudo mysql
CREATE DATABASE wallabag;
CREATE USER 'wallabaguser'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON wallabag.* TO 'wallabaguser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Final Configuration
Access your Wallabag instance via your web browser. Follow the on-screen installation process, providing your database credentials when prompted. Complete the setup, and Wallabag should now be running.
Using Wallabag
You can start saving articles directly from your browser or via the Wallabag app. The application provides a clean interface to manage your reading list, making it easier to catch up on your favorite articles.
FAQs
What are the advantages of self-hosting Wallabag?
Self-hosting Wallabag grants you complete control over your data and privacy. Unlike third-party services, your saved articles and personal information remain secure on your server. Additionally, it allows for customization and integration with other self-hosted services in your homelab.
Can I run Wallabag on Docker?
Yes, you can install Wallabag using Docker containers. This method simplifies the installation and can make it easier to manage dependencies. There are official Docker images available. If you prefer this method, refer to the Wallabag documentation for detailed steps.
How to ensure the security of my Wallabag installation?
To secure your Wallabag instance, consider implementing the following measures:
- Use HTTPS by obtaining an SSL certificate (with Letโs Encrypt, for example).
- Regularly update your server, applications, and dependencies.
- Use strong passwords for your database and Wallabag user accounts.
- Enable a firewall to restrict access to your server.
Conclusion
Self-hosting Wallabag on a VPS is a rewarding project that can help you organize your reading material. With this guide, you can set up your own instance and enjoy the benefits of having control over your data. For a full VPS comparison, visit our full VPS comparison. Happy hosting!