How to Install SysPass on nixOS Latest

This tutorial will walk you through the steps to install SysPass, which is a free password manager that stores encrypted passwords online.

Pre-requisites

Before we proceed with the installation, make sure to have the following packages installed on your nixOS Latest system:

Step 1: Clone SysPass Repository

The first step is to clone the SysPass repository from GitHub. Open the terminal on your nixOS Latest system and run the following command:

git clone https://github.com/nuxsmin/sysPass.git

Step 2: Install Apache Web Server

Now we will install Apache web server using the Nix package manager. To do this, run the following command:

nix-env -iA nixos.apache

After the installation is complete, start the Apache web server using the following command:

sudo systemctl start apache

You can check the status of the Apache service using the following command:

sudo systemctl status apache

Step 3: Install PHP and Required Extensions

SysPass is written in PHP, so we need to install PHP and the required extensions. To do this, run the following command:

nix-env -iA nixos.php

Now install the required PHP extensions using the following command:

nix-env -iA nixos.phpPackages-7.4

Step 4: Configure Apache Virtual Host

In this step, we will configure Apache virtual host to serve SysPass application. Create a new virtual host configuration file using the following command:

sudo nano /etc/apache2/vhosts.d/syspass.conf

Add the following content to the file:

<VirtualHost *:80>
    ServerAdmin admin@yourdomain.com
    DocumentRoot /path/to/syspass
    ServerName yourdomain.com
    <Directory /path/to/syspass>
        AllowOverride all
        Require all granted
    </Directory>
    ErrorLog /var/log/apache2/syspass_error_log
    CustomLog /var/log/apache2/syspass_access_log common
</VirtualHost>

Replace the yourdomain.com placeholder with your domain name and the /path/to/syspass placeholder with the path to SysPass cloned repository.

Save the changes and exit the editor.

Step 5: Install and Configure MySQL

SysPass uses MySQL database to store the passwords. We need to install and configure MySQL to work with SysPass.

To install MySQL using Nix package manager, run the following command:

nix-env -iA nixos.mysql

After the installation is complete, start the MySQL service and enable it to start at boot time using the following commands:

sudo systemctl start mysql
sudo systemctl enable mysql

Now log in to the MySQL console using the following command:

mysql -u root -p

Create a new database and user for SysPass using the following commands:

CREATE DATABASE syspass;
CREATE USER 'syspassuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON syspass.* TO 'syspassuser'@'localhost';
FLUSH PRIVILEGES;

Replace the password placeholder with a secure password for the user.

Step 6: Configure SysPass

In this step, we will configure SysPass to use the MySQL database. Go to the SysPass directory and rename the config.inc.php.sample file to config.inc.php using the following command:

cd sysPass
mv config.inc.php.sample config.inc.php

Open the config.inc.php file using the following command:

nano config.inc.php

Update the following lines with the appropriate values:

define('APP_KEY', ''); // add a random string of characters
define('DB_HOST', 'localhost');
define('DB_NAME', 'syspass');
define('DB_USER', 'syspassuser');
define('DB_PASS', 'password'); // replace with the password you set for the MySQL user
define('USE_HTTPS', false); // set to true if you have an SSL certificate installed

Save the changes and exit the editor.

Step 7: Test SysPass

Now everything is set up, so let's test the SysPass application. Open your web browser and browse to the following URL:

http://yourdomain.com/install/

Follow the on-screen instructions to complete the installation.

After installation is complete, go to the following URL to access the SysPass dashboard:

http://yourdomain.com/

You will be prompted to log in using the default username admin and password password. It is recommended to change the password after logging in.

Congratulations, you have successfully installed SysPass on nixOS Latest!

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!