PineDocs is an open-source, lightweight document management system built with Python and Flask. It allows users to upload, store, and manage documents in a simple and efficient way. In this tutorial, we will show you how to install PineDocs on a Fedora Server latest release.
Before proceeding with the installation, you should have the following:
Before you start installing PineDocs, first, you need to install the following packages:
sudo dnf install git python3-devel python3-pip postgresql postgresql-server postgresql-contrib nginx
PineDocs uses PostgreSQL as a database backend. To install PostgreSQL, run the following command:
sudo dnf install postgresql postgresql-server postgresql-contrib
After installing PostgreSQL, initialize and start the PostgreSQL service using the following commands:
sudo postgresql-setup --initdb
sudo systemctl start postgresql
sudo systemctl enable postgresql
Next, you need to create a new PostgreSQL user and database for PineDocs.
Log in to the PostgreSQL shell:
sudo -i -u postgres
psql
Create a new user and database:
CREATE DATABASE pinedocs;
CREATE USER pinedocs WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE pinedocs TO pinedocs;
Exit the PostgreSQL shell:
\q
exit
Now, you need to clone the PineDocs repository into your system. Navigate to the location where you want to install PineDocs and run the following command:
git clone https://github.com/xy2z/PineDocs.git
Navigate to the PineDocs directory and install the Python dependencies using the following command:
cd PineDocs
sudo pip3 install -r requirements.txt
To configure PineDocs, you need to create a new configuration file. Copy the sample configuration file using the following command:
cp config.py.sample config.py
Open the configuration file using your favorite text editor:
nano config.py
Update the following configuration parameters:
DEBUG = False
SQLALCHEMY_DATABASE_URI = 'postgresql://pinedocs:password@localhost/pinedocs'
SECRET_KEY = 'your_secret_key'
MAIL_SERVER = 'your_mail_server'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USE_SSL = False
MAIL_USERNAME = 'your_mail_username'
MAIL_PASSWORD = 'your_mail_password'
MAIL_DEFAULT_SENDER = 'your_name <your_email_address>'
Save and close the file.
To initialize the PineDocs database, run the following command:
sudo python3 manage.py db init
sudo python3 manage.py db migrate
sudo python3 manage.py db upgrade
To create a Systemd service for PineDocs, create a new file:
sudo nano /etc/systemd/system/pinedocs.service
Paste the following content into the file:
[Unit]
Description=PineDocs Document Management System
After=network.target
[Service]
User=root
Group=root
WorkingDirectory=/path/to/PineDocs
ExecStart=/usr/bin/python3 /path/to/PineDocs/run.py
Restart=always
[Install]
WantedBy=multi-user.target
Save and close the file.
To configure Nginx as a reverse proxy for PineDocs, create a new Nginx server block:
sudo nano /etc/nginx/conf.d/pinedocs.conf
Paste the following content into the file:
server {
listen 80;
server_name example.com;
location /static {
alias /path/to/PineDocs/static;
}
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Replace example.com
with your domain name and /path/to/PineDocs
with the actual path to your PineDocs installation directory.
Save and close the file.
Now, start the PineDocs and Nginx services using the following commands:
sudo systemctl start pinedocs
sudo systemctl enable pinedocs
sudo systemctl start nginx
sudo systemctl enable nginx
Congratulations! You have successfully installed PineDocs on your Fedora Server latest release. You can now upload, store, and manage your documents using PineDocs via your domain name or IP address.
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!
Alternatively, for the best virtual desktop, try Shells!