In this tutorial, we will guide you through the installation process of Pinry on POP! OS Latest. Pinry is an open-source Pinterest clone that allows users to create, save, and organize pins.
Before we begin, ensure that your system is connected to the internet and has administrative privileges.
The first step is to install the necessary dependencies required for Pinry to work correctly.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3 python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx curl
We need to create a database and user for Pinry.
sudo -u postgres psql
CREATE DATABASE pinry;
CREATE USER pinryuser WITH PASSWORD 'password';
ALTER ROLE pinryuser SET client_encoding TO 'utf8';
ALTER ROLE pinryuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE pinryuser SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE pinry TO pinryuser;
Exit the Postgres shell by typing \q
and hitting Enter.
Now we will install Pinry using Git and Pip.
sudo apt-get install git
cd ~
git clone https://github.com/pinry/pinry.git
cd pinry
sudo pip3 install -r requirements.txt
cp pinry/local_settings.py.example pinry/local_settings.py
Use your editor of choice to edit the local_settings.py
file to your preferences. Edits like changing the database username and password to match the newly created database, turning debugging on or off, changing allowed hosts among other items will be made here.
python3 manage.py migrate
python3 manage.py collectstatic
Now let’s check if Pinry works correctly.
python3 manage.py runserver
Open your browser and head to http://localhost:8000
. If Pinry is running correctly, you will see the Pinry login page.
Now we need to make Pinry available on the internet. We will use gunicorn
and nginx
to accomplish this.
sudo pip3 install gunicorn
sudo nano /etc/systemd/system/gunicorn.service
Inside the editor, paste and edit the following to your preferences.
[Unit] Description=gunicorn daemon After=network.target
[Service]
User=
[Install] WantedBy=multi-user.target
Make sure to change <username>
with your own. Save and exit the editor.
sudo systemctl start gunicorn
sudo systemctl enable gunicorn
sudo nano /etc/nginx/sites-enabled/pinry
Inside the editor, paste and edit the following to your preferences.
listen 80;
server_name yourdomain.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/<username>/pinry;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/<username>/pinry/pinry.sock;
}
}
Make sure to substitute <username>
with your own. Save and exit the editor.
sudo nginx -t
sudo systemctl restart nginx
Pinry is now configured and in use via gunicorn and nginx.
You have successfully installed Pinry, created a database and started Pinry with gunicorn and nginx. Pinry should now be up and running on your instance of POP! OS Latest. Enjoy!
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!