Lavagna is an open-source digital whiteboard that can help you to organize your tasks or visualize your ideas. Lavagna is written in Python and requires a web server and a database server to run. In this tutorial, we will show you how to install Lavagna on OpenSUSE Latest.
First of all, we need to install some necessary packages for Lavagna. Open the terminal and run the following command:
sudo zypper install python3 python3-devel python3-pip gcc postgresql postgresql-devel postgresql-server postgresql-contrib libxml2 libxml2-devel libxslt libxslt-devel libffi libffi-devel libicu libicu-devel libjpeg-turbo libjpeg-turbo-devel libyaml-devel python3-lxml python3-psycopg2 python3-gunicorn
Lavagna requires a PostgreSQL database to store its data. We will create a new PostgreSQL database for Lavagna. Run the following command to initialize the PostgreSQL database:
sudo postgresql-setup --initdb
Now start and enable the PostgreSQL service by running:
sudo systemctl start postgresql
sudo systemctl enable postgresql
Next, we will create a new PostgreSQL user and database for Lavagna. Switch to the PostgreSQL user using the following command:
sudo su - postgres
Now login into the PostgreSQL shell by running:
psql
Create a new user for Lavagna and set a password for it:
CREATE USER lavagna WITH PASSWORD 'password';
Create a new database for Lavagna and grant all privileges to the lavagna user:
CREATE DATABASE lavagna OWNER lavagna;
GRANT ALL PRIVILEGES ON DATABASE lavagna TO lavagna;
Exit from the PostgreSQL shell by running:
\q
Exit from the PostgreSQL user by running:
exit
Now we can install Lavagna. First, we need to install virtualenv to isolate the python environment. Run the following command to install virtualenv:
sudo pip3 install virtualenv
Create a new directory for Lavagna and navigate to it:
mkdir lavagna
cd lavagna
Create a new virtual environment for Lavagna:
virtualenv -p python3 env
Activate the virtual environment:
source env/bin/activate
Install Lavagna and its dependencies:
pip3 install lavagna
Create a new configuration file using the example file:
cp env/lib/python3.9/site-packages/lavagna/config.example.yaml lavagna.yaml
Edit the configuration file using your favorite text editor. Set the database connection string to the PostgreSQL user and database that we created earlier. Change the database connection string in the lavagna.yaml file using:
database:
uri: postgresql://lavagna:password@localhost/lavagna
To run Lavagna, we need to activate the virtual environment and run Lavagna using the gunicorn server. Activate the virtual environment by running:
source env/bin/activate
Run Lavagna using the gunicorn server:
gunicorn --bind 0.0.0.0:8000 lavagna.app:app
Now you can access the Lavagna whiteboard by opening your web browser and navigating to http://localhost:8000
.
To automatically start Lavagna after a reboot, we can create a systemd service. Create a new systemd service file:
sudo nano /etc/systemd/system/lavagna.service
Add the following lines to the file:
[Unit]
Description=Lavagna Web Server
After=network.target
[Service]
User=yourusername
Group=yourusername
WorkingDirectory=/path/to/lavagna
ExecStart=/path/to/lavagna/env/bin/gunicorn --bind 0.0.0.0:8000 lavagna.app:app
[Install]
WantedBy=multi-user.target
Save and close the file. Reload the systemd daemon:
sudo systemctl daemon-reload
Start and enable the Lavagna service:
sudo systemctl start lavagna
sudo systemctl enable lavagna
Now Lavagna will automatically start after a reboot.
In this tutorial, we showed you how to install Lavagna on OpenSUSE Latest. Lavagna is a powerful tool that can help you to organize your tasks or visualize your ideas. With a little bit of setup, you can have your own digital whiteboard running on your own computer.
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!