How to Install Wallabag on Void Linux

Wallabag is a self-hosted read-it-later service that helps you save articles to read them later, even when you’re offline. This tutorial will show you how to install Wallabag on Void Linux.

Prerequisites

Before starting the installation, you need to make sure your system meets the following requirements:

Step 1: Install Required Packages

The first thing you need to do is to update your system and install the required packages. Open the terminal and run the following command:

sudo xbps-install -Syu
sudo xbps-install git wget nginx php-fpm php-pdo_sqlite php-cli php-mbstring php-curl php-xml php-intl php-gd sqlite

Step 2: Install Composer

Composer is a dependency manager for PHP. We need to install it to install Wallabag. Run the following command in the terminal to install Composer:

sudo wget https://getcomposer.org/installer -O /tmp/composer-setup.php
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer

Step 3: Clone the Wallabag Repository

Next, we need to clone the Wallabag repository from GitHub. Run the following command in the terminal to clone the repository:

cd /var/www/
sudo git clone https://github.com/wallabag/wallabag.git

Step 4: Install the Required Packages for Wallabag

Navigate to the Wallabag directory and run the following command to install the required PHP packages:

cd wallabag
sudo composer install --no-dev --optimize-autoloader

Step 5: Create a Configuration File

Copy the app/config/parameters.yml.dist file to app/config/parameters.yml:

sudo cp app/config/parameters.yml.dist app/config/parameters.yml

Step 6: Adjust the Configuration File

Edit the /var/www/wallabag/app/config/parameters.yml file:

sudo nano app/config/parameters.yml

Replace the following line:

database_path: %kernel.root_dir%/data/db.sqlite

with:

database_path: /var/lib/wallabag/data/wallabag.sqlite

Step 7: Create a Systemd Service File

Create a service file /etc/systemd/system/wallabag.service:

sudo nano /etc/systemd/system/wallabag.service

Add the following content in the service file:

[Unit]
Description=Wallabag Service
After=network-online.target

[Service]
ExecStart=/usr/bin/php /var/www/wallabag/bin/console server:run 0.0.0.0:8080
WorkingDirectory=/var/www/wallabag
Restart=always
User=www-data

[Install]
WantedBy=multi-user.target

Save and exit the file.

Step 8: Configure Nginx

We need to configure Nginx to serve Wallabag. Create an Nginx configuration file /etc/nginx/conf.d/wallabag.conf:

sudo nano /etc/nginx/conf.d/wallabag.conf

Add the following configuration:

upstream php {
    server unix:/run/php/php-fpm.sock;
}

server {
    listen 80;
    server_name your_domain.com; # Change this to your domain name
    root /var/www/wallabag/web;
    access_log /var/log/nginx/wallabag_access.log;
    error_log /var/log/nginx/wallabag_error.log;

    client_max_body_size 20M;

    location / {
        try_files $uri /app.php$is_args$args;
    }

    location ~ ^/(app|app_dev|config|oauth/v2|register|resetting) {
        deny all;
    }

    location ~ ^/(var/cache|var/logs|app/config) {
        deny all;
    }

    location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
        access_log off;
        expires 60d;
        add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }

    location ~ \.php$ {
        try_files $uri /app.php$is_args$args;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php;
        fastcgi_index app.php;
        fastcgi_param APP_ENV prod;
        include fastcgi_params;
    }
}

Replace your_domain.com with your own domain name.

Save and exit the file.

Step 9: Restart Services

Restart the required services:

sudo systemctl daemon-reload
sudo systemctl start php-fpm nginx wallabag
sudo systemctl enable php-fpm nginx wallabag

Step 10: Access Wallabag

Open your web browser and visit http://your_domain.com. You should see the Wallabag login page.

Congratulations! You have successfully installed Wallabag on Void Linux. You can now use it to save articles and read them later.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!