Installing Wallabag on Ubuntu Server

This tutorial will guide you through the steps required to install Wallabag on a fresh Ubuntu Server.

Prerequisites

Step 1: Update package repositories

First, update the package repositories by running the following command:

sudo apt update

Step 2: Install required packages

Next, install the required packages for Wallabag by running:

sudo apt install -y mariadb-server mariadb-client nginx php-fpm php-mysql php-mbstring php-xml php-curl php-intl composer

During the installation, you will be prompted to set a root password for the MariaDB database server.

Step 3: Configure databases

Create a new MariaDB database and user for Wallabag:

sudo mysql -u root -p

Enter your root password when prompted and run the following commands:

CREATE DATABASE wallabag;
GRANT ALL PRIVILEGES ON wallabag.* TO 'wallabag'@'localhost' IDENTIFIED BY 'your_password';
FLUSH PRIVILEGES;
EXIT;

Be sure to replace "your_password" with a strong, secure password.

Step 4: Install and configure Wallabag

Create a new directory for Wallabag and navigate to it:

mkdir ~/wallabag
cd ~/wallabag

Download the latest version of Wallabag from their website:

wget https://wllbg.org/latest -O wallabag.tar.gz

Extract the contents of the archive:

tar -xzf wallabag.tar.gz

Install Wallabag and its dependencies using Composer:

composer install --no-dev --optimize-autoloader

Create a new configuration file by copying the example:

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

Edit the configuration file and update the following lines:

database_host: 127.0.0.1
database_port: null
database_name: wallabag
database_user: wallabag
database_password: your_password

Be sure to replace "your_password" with the password you set in Step 3.

Set the correct permissions on the var directory:

chmod 777 -R var/

Step 5: Configure web server

Nginx

Create a new configuration file:

sudo nano /etc/nginx/sites-available/wallabag

Insert the following contents:

server {
    listen 80;
    server_name your_domain.com; # replace with your own domain name

    root /var/www/wallabag/web;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param APP_ENV prod;
    }

    location ~ /\.ht {
        deny all;
    }
}

Save and exit the file.

Create a symbolic link to enable the new site:

sudo ln -s /etc/nginx/sites-available/wallabag /etc/nginx/sites-enabled/

Test the configuration and restart the Nginx service:

sudo nginx -t
sudo systemctl restart nginx

Apache

Create a new configuration file:

sudo nano /etc/apache2/sites-available/wallabag.conf

Insert the following contents:

<VirtualHost *:80>
    ServerName your_domain.com # replace with your own domain name
    DocumentRoot /var/www/wallabag/web

    <Directory /var/www/wallabag/web>
        AllowOverride None
        Order Allow,Deny
        Allow from All
        FallbackResource /index.php
    </Directory>

    <Directory /var/www/wallabag/web/bundles>
        FallbackResource disabled
    </Directory>

    <Directory /var/www/wallabag/web/bundles/SimpleMDE>
        FallbackResource disabled
    </Directory>

    <IfModule mod_php5.c>
        php_value newrelic.appname "wallabag"
    </IfModule>

    SetEnv APP_ENV prod

    ErrorLog ${APACHE_LOG_DIR}/wallabag_error.log
    CustomLog ${APACHE_LOG_DIR}/wallabag_access.log combined
</VirtualHost>

Save and exit the file.

Enable the new site and restart the Apache service:

sudo a2ensite wallabag
sudo systemctl restart apache2

Step 6: Access Wallabag

Wallabag should now be accessible from your web browser at http://your_domain.com. Follow the on-screen instructions to complete the installation.

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!