How to Install KooZic on Debian Latest

KooZic is an open-source media manager designed for personal use or small businesses. It allows you to organize and manage your music library, photos, and videos with ease. In this tutorial, we will show you how to install KooZic on Debian Latest.

Prerequisites

Before we begin, you must have the following installed:

Step 1: Update your system

First, you need to ensure your system is up-to-date. To do this, log in as root or with sudo privileges and run the following command:

apt-get update && apt-get upgrade -y

This command will update your system and upgrade your current packages to the latest versions.

Step 2: Install Required Packages

After updating the system, we need to install some required packages for KooZic. These dependencies are PostgreSQL, Python3, NGINX, and Git.

apt-get install postgresql postgresql-contrib python3 nginx git -y

Step 3: Install and Configure PostgreSQL

Now that we have installed PostgreSQL, we can proceed with creating the KooZic database and user in PostgreSQL.

We can do that by running the following commands:

sudo su - postgres
createdb koozic
createuser -P koozic

Once the user is created, we need to grant the necessary privileges to the koozic user by logging in to PostgreSQL shell:

psql
GRANT ALL PRIVILEGES ON DATABASE koozic TO koozic;
\q

Step 4: Install KooZic

Let's clone the KooZic repository using the Git command below:

git clone https://github.com/DocMarty84/KooZic.git koozic

Once it's done, navigate into the KooZic directory and run the following commands:

cd koozic
pip3 install -r requirements.txt

Step 5: Configure KooZic

Before running KooZic, we need to configure it. Navigate into the KooZic directory and edit the config.py file.

nano config.py

Update the following details:

SECRET_KEY = "your-own-secret-key"

SQLALCHEMY_DATABASE_URI = "postgresql://koozic:password@localhost/koozic"

Make sure to replace your-own-secret-key with your own secret key, and password with the password you have set for the koozic user in PostgreSQL.

Now, run the below command to create the necessary database tables:

python3 manage.py db upgrade

Step 6: Configure NGINX

We will use NGINX as a reverse proxy server for KooZic. Create an NGINX virtual host configuration file:

nano /etc/nginx/sites-available/koozic

Copy and paste the following configuration code:

server {
    listen 80;
    server_name yourdomain.com ;

    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;
    }
}

Make sure to replace yourdomain.com with your own domain name.

Save and close the file, and then create a symbolic link to enable the virtual host configuration:

ln -s /etc/nginx/sites-available/koozic /etc/nginx/sites-enabled/

Test for configuration syntax errors:

nginx -t

Finally, restart Nginx:

systemctl restart nginx

Step 7: Start KooZic

Now we can start KooZic with the following command:

python3 manage.py runserver --host 0.0.0.0 --port 5000

You can now access KooZic at http://yourdomain.com.

Conclusion

You have successfully installed KooZic on Debian Latest. You can now add your music library and start using all its features to manage and organize your media.

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!