How to Install Paperless-ngx on NixOS Latest
In this tutorial, we’ll cover the steps required to install Paperless-ngx on NixOS Latest. Paperless-ngx is a self-hosted, open-source, document management system that is specifically designed for creating a paperless office.
Prerequisites
Before we begin the installation process, there are a few prerequisites that need to be fulfilled:
- A running instance of the NixOS Latest operating system.
- A non-root user with sudo privileges.
Step 1: Install Necessary Dependencies
The first step is to install all the necessary dependencies that Paperless-ngx requires. This can be done by running the following command:
sudo nix-env -iA nixos.pkgs.python37Packages.virtualenv \
nixos.pkgs.buildPackages.libjpeg-turbo nixos.pkgs.tesseract
Step 2: Download Paperless-ngx
Next, we need to download the latest stable version of Paperless-ngx. It can be downloaded from the official Github repository using the following command:
git clone https://github.com/jonaswinkler/paperless-ng
Once the download is complete, CD into the paperless-ng directory:
cd paperless-ng
Step 3: Create a Virtual Environment
It is best practice to install Paperless-ngx in a virtual environment. This helps reduce the chance of dependency conflicts. The virtual environment can be created using the following command:
python3 -m venv env
After the virtual environment is created, activate it with the following command:
source env/bin/activate
Step 4: Install Paperless-ngx
With the virtual environment activated, we can now install Paperless-ngx:
pip install -r requirements.txt
Step 5: Configure Paperless-ngx
Next, we need to configure Paperless-ngx. Copy the sample.env file to .env:
cp sample.env .env
Open the .env file and configure any necessary settings.
Step 6: Setup the Database
Paperless-ngx requires a database to store its data in. By default, Paperless-ngx uses SQLite. However, other databases can be used as well. In this tutorial, we’ll be using SQLite.
Create the database by running the following command:
python manage.py migrate
Step 7: Run Paperless-ngx
Finally, we can run Paperless-ngx:
python manage.py runserver
And that’s it! Paperless-ngx should now be accessible from your web browser at http://localhost:8000/.
Conclusion
In this tutorial, we’ve covered how to install Paperless-ngx on NixOS Latest. With Paperless-ngx installed, you can create a paperless office and manage all your documents in a digital form.