How to Install Wallabag on nixOS Latest
Wallabag is a self-hosted web application that allows you to save articles for reading later. In this tutorial, we will show you how to install Wallabag on nixOS latest.
Prerequisites
Before we begin, ensure you have the following:
- A running nixOS latest server
- An active SSH session towards the server
- A sudo user
Step 1: Install Nginx
First, we need to install Nginx, which will act as a reverse proxy for Wallabag. To do so, run the following command:
sudo nix-env -iA nixos.nginx
Step 2: Install PHP
Wallabag is written in PHP and requires PHP 7.3 or higher to run correctly. To install PHP and the required packages, run the following command:
sudo nix-env -iA nixos.php73 php73-fpm php73-intl php73-gd php73-mbstring php73-mysql
Step 3: Download Wallabag
Next, we need to download the latest version of Wallabag. To do so, run the following command:
sudo wget https://www.wallabag.org/releases/wallabag-latest.zip
Step 4: Install Wallabag
After downloading Wallabag, we need to install it to the webserver, /var/www/wallabag. To install, run the following command:
sudo unzip wallabag-latest.zip -d /var/www/wallabag/
Step 5: Configure Nginx
After installing Wallabag, we need to configure Nginx to work with Wallabag. To do so, create the file /etc/nginx/sites-available/wallabag with the following content:
server {
listen 80;
server_name example.com; # Change to your domain name
root /var/www/wallabag/public;
location / {
index index.php;
try_files $uri /index.php?$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
After saving the file, create a symlink to enable the site:
sudo ln -s /etc/nginx/sites-available/wallabag /etc/nginx/sites-enabled/
Finally, restart Nginx to apply the configuration:
sudo systemctl restart nginx
Step 6: Configure Wallabag
After configuring Nginx, we need to configure Wallabag. Open the file /var/www/wallabag/.env and configure the following settings:
MAILER_URL=null://localhost # Change to your email provider
DATABASE_URL="mysql://user:password@localhost:3306/wallabag"
WALLABAG_URL=http://example.com # Change to your domain name
After saving the file, run the following commands to complete the installation:
cd /var/www/wallabag
sudo php bin/console wallabag:install
Step 7: Accessing Wallabag
After completing the installation, Wallabag should be accessible from your browser by visiting the URL http://example.com. Login to your Wallabag instance using the default username admin and password w@llabag.
Congratulations! You have successfully installed Wallgab on nixOS latest. Enjoy saving articles to read later!