Skip to main content

Install Wallabag on Ubuntu 16.04 Server with LAMP or LEMP

install wallabag read later app on ubuntu 16.04

Wallabag is a free self-hostable application for saving web pages. It’s an open source alternative to other proprietary read later app like Pocket and Instapaper, allowing you to manage a list of articles you stumbled upon on the Internet for later reading.

Wallabag Features:

  1. Wallabag strips ads and unrelated stuff from your web pages and provide only article text and related images so they can be easily read. This is especially useful when you are viewing them on a smartphone or tablet.
  2. Wallabag saves your web pages in a database so even if the original web page disappears, you can still view it in Wallabag.
  3. You can easily export all your web page to TXT, HTML, CSV, EPUB, MOBI, PDF, or JSON file.
  4. You can also install the Wallabag browser extension and smartphone app to easily access Wallabag.

This tutorial covers how to host your own Wallabag service on an Ubuntu 16.04 server or VPS.


To install wallabag, you will need to have access to a user with root privileges.

It’s assumed that you have already set up a LAMP stack or LEMP stack on Ubuntu 16.04. Wallabag is able to run with PHP >= 5.5, including PHP 7. If you haven’t already done so, check out the following easy to follow guides.

Install Apache, MariaDB and PHP7 (LAMP Stack) on Ubuntu 16.04 LTS

Install Nginx, MariaDB and PHP7 (LEMP Stack) on Ubuntu 16.04 LTS

Once you are done, come back here and read on.

Log in Via SSH

Log in to your server as the new user that you created (or root) via SSH (substitute your user name and server IP address here):

ssh new_user@server_IP_address

Answer the password prompt to complete the login process.

Let’s get started with the Wallabag installation!

Step 1: Create a Database and User for Wallabag

Wallabag needs a database to store your web pages and we are going to use MariaDB/MySQL database in this tutorial. Run the following command to log into MariaDB/MySQL shell as root. Note that this is the MariaDB/MySQL root user, not the root user of Ubuntu 16.04 system.

mysql -u root -p

If you see Access denied for user 'root'@'localhost' error, then you need to disable unix socket authentication.

Then create a new database for Wallabag using the following command. This tutorial name it wallabag, you can use whatever name you like for the database.

create database wallabag;

Next, create a new database user on localhost using the following command. Again, this tutorial name it wallabaguser, you can use whatever name you like.

create user wallabaguser@localhost;

Set a password for the user. Replace your-password with your preferred password.

set password for wallabaguser@localhost= password("your-password");

Then grant all permission of the new database to the new user so later on Wallabag can write to the database.

grant all privileges on wallabag.* to wallabaguser@localhost identified by 'your-password';

Flush the privileges table for the changes to take effect.

flush privileges;

Exit MariaDB Shell:


Your web pages will be stored in wallabag_entry table after you finished installing wallabag at the end of this tutorial.

Step 2: Install php7.0-mysql Package

Another important thing we need to do concerning the database is install the php7.0-mysql package.

sudo apt install php7.0-mysql

The php7.0-mysql packages provides the pdo_mysql driver which will be used by wallabag to connect to MariaDB/MySQL database, otherwise Wallabag has no way to connect to it. If you are running PHP as an Apache module, then after the package is installed, you must restart Apache Web server so the driver will be enabled.

sudo systemctl restart apache2

If you are running PHP with php7.0-fpm, then you don’t need to restart Apache or php7.0-fpm. The pdo_mysql driver will be enable automatically after installed.

If you are not sure whether you are using Apache module or php7.0-fpm, then create a test.php file under the document root (by default /var/www/html).

sudo nano /var/www/html/test.php

Then paste the following PHP code into the file.

<?php phpinfo(); ?>

Press Ctrl+O to save the file, then press Ctrl+X to exit. Now in the browser address bar, enter


Replace sever-ip-address with your actual IP. You should see your server’s PHP information. If the value of Server API is Apache 2.0 Handler, then you are using PHP7.0 as an Apache Module. If the value is PHP7.0-FPM, then PHP is running as a FPM service.

Step 3: Install Composer

We need to install Composer which is a dependency manager for PHP. It will download and install all necessary Wallabag dependencies for us.

Make sure PHP command line interface is installed:

sudo apt install php7.0-cli

Then use the below command to download the Composer installer to the current directory. It will be saved as composer-setup.php.

php -r "copy('', 'composer-setup.php');"

Next, run the below command to verify the installer SHA-384 so it can be trusted.

php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

If the verification is successful, you will see the following message.

Installer Verified

Now run the installer. This tutorial installs composer to the system-wide /usr/local/bin directory and specify composer as the filename. Since /usr/local/bin/ is in the user’s PATH, it allows the user to use composer command globally.

sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

The installer will check php.ini file for incorrect settings, and then download the latest composer.phar to the /usr/local/bin and rename the filename to composer. Here’s a sample output:

All settings correct for using Composer
Downloading 1.1.3...

Composer successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

To remove the Composer installer from the current dirctory, run:

php -r "unlink('composer-setup.php');"

Step 4: Install Wallabag

We will use the git tool to clone the Wallabag repository from Github and later install Wallabag with Composer. So install git on Ubuntu 16.04 with the below command:

sudo apt install git

Then clone the Wallabag repository and change your working directory to the repository.

git clone

cd wallabag

The lastest version of Wallabag (2.0.8) was released on September 7, 2016. Switch to version 2.0.6 with the git checkout command.

git checkout 2.0.8

Before we install Wallabag with Composer, we need to make sure the following PHP extensions are installed on Ubuntu 16.04.

sudo apt install php7.0-xml php7.0-zip php7.0-curl php7.0-mbstring php7.0-gd

Now set Symfony variable and install Wallabag using the following command. SYMFONY_ENV=prod tells symfony we’re installing Wallabag in a production environment. The --no-dev flag ensures that no development packages are installed in production environment.

SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist

During the installation process, composer will download and install all needed dependencies.

After that, you will be asked to provide missing parameters so that the app/config/parameters.yml file can be created. Composer already provides some default values but they cannot be used for a production Wallabag service.

For simplicity, let’s break the questions into two parts. The first part is about database parameters. Here is the questions and the parameters this tutorial provides.

Creating the "app/config/parameters.yml" file
 Some parameters are missing. Please provide them.
 database_driver (pdo_sqlite): pdo_mysql
 database_host (
 database_port (null): 3306
 database_name (symfony): wallabag
 database_user (root): wallabaguser
 database_password (null): your-password
 database_path ('%kernel.root_dir%/../data/db/wallabag.sqlite'): /var/lib/mysql/wallabag
 database_table_prefix (wallabag_): wallabag_

This first question is what database driver, i.e, what database you want to use for Wallabag. The default driver is pdo_sqlite which means SQLite database will be used to store web pages. This article will use MariaDB/MySQL because they are speedy and are the most popular open source relation database management system. We have already enabled the pdo_mysql driver in the beginning of this article. So enter pdo_mysql as the answer for the first question.

The other questions are easy to answer. Enter as the database host and 3306 as the database port because by default MariaDB/MySQL database will listen on Then enter the database name, database user and database user password you created in step 1. The default database path of MariaDB/MySQL is /var/lib/mysql. All you databases and tables are stored under this directory. The database table prefix helps you to recognize these tables are for Wallabag.

Now in the second part you can just press Enter to use the default values.

 mailer_transport (smtp):
 mailer_host ( 
 mailer_user (null): 
 mailer_password (null):
 locale (en): 
 secret (ovmpmAWXRCabNlMgzlzFXDYmCFfzGv): 
 twofactor_auth (true): 
 twofactor_sender ([email protected]): 
 fosuser_confirmation (true): 
 from_email ([email protected]):

Once that’s done, run the following command.

php bin/console wallabag:install --env=prod

It will check system requirements and set up database. When it asks would you like to reset the database, press n to answer no. Then you will be asked to create an admin user.

Installing Wallabag...

Step 1 of 5. Checking system requirements.
| Checked         | Status | Recommendation |
| PDO Driver      | OK!    |                |
| curl_exec       | OK!    |                |
| curl_multi_init | OK!    |                |
Success! Your system can run Wallabag properly.

Step 2 of 5. Setting up database.
It appears that your database already exists. Would you like to reset it? (y/N)n
Creating schema
Clearing the cache

Step 3 of 5. Administration setup.
Would you like to create a new admin user (recommended) ? (Y/n)y
Username (default: wallabag) : your-admin-username
Password (default: wallabag) : admin-pasword-here
Email: admin-email-here

Step 4 of 5. Config setup.

Step 5 of 5. Installing assets.

Wallabag has been successfully installed.
Just execute `php bin/console server:run --env=prod` for using wallabag: http://localhost:8000

Step 2 will create wallabag database tables. Once that’s done, we move the wallabag directory to  /var/www/.

cd ~

sudo mv ~/wallabag/ /var/www/

Then set Apache user (www-data) as the owner.

sudo chown www-data:www-data /var/www/wallabag -R

Step 4: Set up Apache Virtual Host

Create a virtual host configuration file for Wallabag.

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

If you use PHP as an Apache module, then copy and paste the following text into the configuration file. Replace with your own domain name. You should also point your domain name to the IP address of your Ubuntu 16.04 server in DNS.

<VirtualHost *:80>

    DocumentRoot /var/www/wallabag/web
    <Directory /var/www/wallabag/web>
        AllowOverride None
        Order Allow,Deny
        Allow from All

        <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ app.php [QSA,L]

    # uncomment the following lines if you install assets as symlinks
    # or run into problems when compiling LESS/Sass/CoffeScript assets
    # <Directory /var/www/wallabag>
    #     Options FollowSymlinks
    # </Directory>

    # optionally disable the RewriteEngine for the asset directories
    # which will allow apache to simply reply with a 404 when files are
    # not found instead of passing the request into the full symfony stack
    <Directory /var/www/wallabag/web/bundles>
        <IfModule mod_rewrite.c>
            RewriteEngine Off
    ErrorLog /var/log/apache2/wallabag_error.log
    CustomLog /var/log/apache2/wallabag_access.log combined

The above configuration uses PHP as an Apache module, if you want to run PHP with php7.0-fpm, then add the ProxyPassMatch rule below CustomLog.

CustomLog /var/log/apache2/wallabag_access.log combined
 ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/run/php/php7.0-fpm.sock|fcgi://localhost/var/www/wallabag/web/

Save and close the file. In the above configuration, we used the Apache rewrite module to rewrite URL. We need to make sure mod_rewrite is enabled by running the following command so that URL rewriting will be working and Wallabag front end can be properly displayed.

sudo a2enmod rewrite

Then enable this virtual host by creating a symbolic link.

sudo ln -s /etc/apache2/sites-available/wallabag.conf /etc/apache2/sites-enabled/

And to put the above changes into effect, restart Apache.

sudo systemctl restart apache2

Now you should be able to access your Wallabag web interface at and login.

wallabag read later

Setting up Nginx Server Block File

Create the file.

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

Copy and paste the following text into the configuration file. Replace with your own domain name. You should also point your domain name to the IP address of your Ubuntu 16.04 server in DNS.

server {
  root /var/www/wallabag/web;

  location / {
    # try to serve file directly, fallback to app.php
    try_files $uri /app.php$is_args$args;
  location ~ ^/app\.php(/|$) {
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
    fastcgi_param DOCUMENT_ROOT $realpath_root;

error_log /var/log/nginx/wallabag_error.log;
access_log /var/log/nginx/wallabag_access.log;

Save and close the file. Then reload Nginx so the server block can be enabled.

sudo systemctl reload nginx

Now you should be able to access your wallabag web interface at and login.

Setting Up a Basic SMTP Server

Note that in order to register new users, your Ubuntu 16.04 server needs to have a SMTP server running to send confirmation emails to new users. You can use Postfix for this purpose.

sudo apt install postfix

During the installation, it will ask you to select a configuration type for Postfix. Select Internet Site so that Postfix can send emails to other SMTP servers on the Internet.


In the system mail name field, enter something like


And now we are finally done and can start saving web pages. Cheers!

install wallabag on ubuntu 16.04 server

I hope this tutorial helped you to install Wallabag on Ubuntu 16.04 server with LAMP or LEMP. As always, if you found this post useful,  subscribe to our free newsletter or follow us on Google+Twitteror like our Facebook page.

Rate this tutorial
[Total: 1 Average: 5]
  • Thanks a bunch for that detailed walk-through. I tried installing Wallabag before but despaired over their somewhat sparse documentation.