How to Install Trac on Debian Latest

Trac is an open-source project management and bug tracking tool, often used for software development projects. In this tutorial, we will guide you through the steps on how to install Trac on the latest Debian version.

Prerequisites

Before installing Trac, you should have:

Step 1: Install required dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install python-setuptools python-pysqlite2 python-genshi python-lxml
sudo apt install python-mysqldb
sudo apt install python-psycopg2

Step 2: Install Trac

wget https://trac.edgewall.org/wiki/TracDownload#LatestStableRelease
unzip Trac-x.x.x.zip
sudo mv Trac-x.x.x /usr/share/trac
sudo ln -s /usr/share/trac/trac-admin /usr/bin/trac-admin

Step 3 Configure Your Database

Trac supports various databases, including SQLite, MySQL, and PostgreSQL.

SQLite

sudo mkdir -p /var/trac
sudo sqlite3 /var/trac/trac.db

MySQL

mysql -u root -p
CREATE DATABASE tracdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'trac'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT ALL PRIVILEGES ON tracdb.* to 'trac'@'localhost';
FLUSH PRIVILEGES;
exit

PostgreSQL

sudo -u postgres psql
CREATE USER trac WITH PASSWORD 'your_password_here';
CREATE DATABASE tracdb OWNER trac ENCODING 'UTF8';
\q

Step 4 Create a new Trac project

sudo trac-admin /path/to/your/new/trac/project initenv

SQLite

Database connection string [sqlite:db/trac.db]:

MySQL

Database connection string [mysql://user:password@host/dbname]:

PostgreSQL

Database connection string [postgres://user:password@host/dbname]:
sudo tracd --port 8000 /path/to/your/new/trac/project

Conclusion

You have successfully installed and configured Trac on your Debian system, started a new project, and configured a database connection.

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!