How to Install Paperless-ngx on FreeBSD Latest
Paperless-ngx is a document management system written in Python, which can help you to manage your documents, files, and receipts efficiently. In this tutorial, we will guide you through the steps to install Paperless-ngx on FreeBSD Latest.
Prerequisites
Before we start, make sure that you have the following dependencies installed on your system:
- Python 3.x
- PostgreSQL
- Git
Step 1: Install Required Dependencies
Update the package repository on your system by running the following command in the terminal:
sudo pkg update
Once the update is completed, install the required dependencies using the following command:
sudo pkg install python37 py37-pip py37-virtualenv postgresql13-server git
Step 2: Install and Configure PostgreSQL
Now, we need to install and configure PostgreSQL on our FreeBSD system. Run the following command to install and start the PostgreSQL server:
sudo service postgresql initdb
sudo service postgresql start
Next, we need to create a new user and database for Paperless-ngx. Login to PostgreSQL shell with the following command:
sudo -u postgres psql
Create a new user:
CREATE ROLE paperless WITH LOGIN PASSWORD 'password';
Create a new database:
CREATE DATABASE paperless OWNER paperless;
Exit the PostgreSQL shell with the following command:
\q
Step 3: Clone and Install Paperless-ngx
Now, we can clone the Paperless-ngx repository to our system:
git clone https://github.com/jonaswinkler/paperless-ng.git
After cloning the repository, navigate to the paperless-ng directory:
cd paperless-ng
Create a new virtual environment for Paperless-ngx:
python3 -m venv env
Activate the virtual environment:
source env/bin/activate
Next, we can install the required Python packages:
pip install -r requirements.txt
Step 4: Configure Paperless-ngx
To configure Paperless-ngx, we need to create a new configuration file. Make a copy of the default configuration file:
cp env.example .env
Open the .env file with your favorite text editor and modify the following settings:
# Database settings
DB_NAME=paperless
DB_USER=paperless
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=5432
# Secret key for the app
SECRET_KEY=Replace_With_a_Strong_Secret_Key
# Administrators
[email protected]
ADMIN_PASSWORD=Replace_With_a_Strong_Password
# Email settings
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
[email protected]
EMAIL_HOST_PASSWORD=password
EMAIL_USE_TLS=True
Save and close the .env file.
Step 5: Run Paperless-ngx
To run Paperless-ngx, we need to activate the virtual environment and run the server. Activate the virtual environment again:
source env/bin/activate
Run the server:
./manage.py migrate
./manage.py createsuperuser
./manage.py runserver
Now, you can access the Paperless-ngx web interface by opening a web browser and visiting http://localhost:8000/. You can log in with the superuser account that you have just created.
Conclusion
In this tutorial, we have shown you how to install Paperless-ngx on FreeBSD Latest. You can customize Paperless-ngx to fit your needs and start managing your documents efficiently.