In this tutorial, we will learn how to install EveryDocs, which is a document management system developed in Python. We will install it on Elementary OS Latest, which is a lightweight, fast and open-source Linux distribution. We will use the GitHub repository to download and install EveryDocs.
Before we begin, you need to ensure that you have the following:
CTRL+ALT+T
.Follow these steps to install EveryDocs on your Elementary OS:
Open the Terminal.
Install the needed system packages by executing the following command:
sudo apt-get install python3 python3-pip nginx python3-venv python3-dev libpq-dev libxml2-dev libxslt1-dev libjpeg-dev libfreetype6-dev
Create and activate a Python virtual environment. You can do this by executing the following commands:
python3 -m venv ~/.everydocs
source ~/.everydocs/bin/activate
Download EveryDocs from the GitHub repository by executing the following command:
git clone https://github.com/jonashellmann/everydocs-core.git
Change to the cloned repository directory by executing the following command:
cd everydocs-core
Install the Python dependencies by executing the following command:
pip install -r requirements.txt
Create the PostgreSQL database by executing the following commands:
sudo su postgres
createdb everydocsdb
createuser everydocsuser
psql
GRANT ALL PRIVILEGES ON DATABASE everydocsdb TO everydocsuser;
ALTER USER everydocsuser WITH PASSWORD 'yourpassword';
\q
exit
Note: Remember to replace 'yourpassword' with your desired password.
Create a configuration file by executing the following command:
cp everydocs/settings/local.py.example everydocs/settings/local.py
Edit the configuration file by executing the following command:
nano everydocs/settings/local.py
Update the following parameters in the configuration file:
SECRET_KEY = 'generateyoursecretkey'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'everydocsdb',
'USER': 'everydocsuser',
'PASSWORD': 'yourpassword',
'HOST': 'localhost',
'PORT': '',
}
}
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]']
Note: Remember to replace 'generateyoursecretkey' with a random string of characters.
Run the database migrations by executing the following command:
python manage.py migrate
Create a superuser by executing the following command:
python manage.py createsuperuser
Collect the static files by executing the following command:
python manage.py collectstatic
Test the installation by executing the following command:
python manage.py runserver
Open a web browser and access http://localhost:8000/. You should see the EveryDocs login page.
Use Ctrl+C to stop the development server, and deactivate the Python virtual environment, by executing the following commands:
deactivate
Install Gunicorn and create a systemd service
Install Gunicorn by executing the following command:
pip install gunicorn
Create a systemd service unit by executing the following command:
sudo nano /etc/systemd/system/everydocs.service
Add the following content to the file:
[Unit]
Description=EveryDocs Systemd Service
After=network.target
[Service]
User=yourusername
WorkingDirectory=/home/yourusername/everydocs-core/
Environment="PATH=/home/yourusername/.everydocs/bin"
ExecStart=/home/yourusername/.everydocs/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/yourusername/everydocs-core/everydocs.sock everydocs.wsgi:application
[Install]
WantedBy=multi-user.target
Note: Change yourusername
to your actual username.
Reload the systemd daemon by executing the following command:
sudo systemctl daemon-reload
Start and enable the EveryDocs service by executing the following commands:
sudo systemctl start everydocs
sudo systemctl enable everydocs
Configure nginx
Create a new server block by executing the following command:
sudo nano /etc/nginx/sites-available/everydocs
Add the following content to the file:
server {
listen 80;
server_name yourdomain.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/yourusername/everydocs-core;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/yourusername/everydocs-core/everydocs.sock;
}
}
Note: Change yourdomain.com
and yourusername
to the actual values.
Create a symbolic link by executing the following command:
sudo ln -s /etc/nginx/sites-available/everydocs /etc/nginx/sites-enabled/
Test the nginx configuration:
sudo nginx -t
Restart the nginx service by executing the following command:
sudo systemctl restart nginx
Open a web browser and access your domain. You should see the EveryDocs login page.
Congratulations! You have successfully installed EveryDocs on Elementary OS. You can now start using EveryDocs to manage your documents.
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!