Skip to content

Installation

This page will teach you how to install CatAsk on your server and configure it.

Prerequisites

  • PostgreSQL
  • Python 3.10+ (3.12+ recommended)
  • Git

Installing

Clone the project's repository:

git clone https://codeberg.org/catask-org/catask.git

Warning

It's not recommended to install CatAsk into protected folders (such as /opt on Linux), as you might face permission issues and other problems.

VPS

Go into the cloned repository, create a virtual environment and activate it:

python -m venv venv && . venv/bin/activate
python -m venv venv; .\venv\Scripts\activate

After that, install required packages:

pip install -r requirements.txt

Then, create the database and the user for CatAsk:

CREATE USER '<DB_USER>' WITH PASSWORD "<DB_PASS>";
CREATE DATABASE "<DB_NAME>" OWNER '<DB_USER>';

Shared hosting

If your shared hosting provider supports WSGI, FastCGI, or something similar, use it (technically any CGI protocol could work)

Post-install

Configuration

First, rename .env.example to .env and config.example.json to config.json, then configure all the values below:

.env

DB_HOST - database host (usually 127.0.0.1)
DB_NAME - database name
DB_USER - database user
DB_PASS - database password
DB_PORT - database port (usually 5432)
ADMIN_PASSWORD - password to access admin panel
APP_SECRET - application secret, generate one with this command: python3 -c 'import secrets; print(secrets.token_hex())'


After you're done configuring CatAsk, init the database:

flask init-db
If that doesn't work (e.g. tables are missing), try importing schema.sql into the created database manually

Usage

Start CatAsk with this command:

gunicorn -w 4 app:app
If you want CatAsk to be accessible on a specific host address, specify a --bind option to the command (e.g. --bind 127.0.0.1:5000)
For debugging, run flask run --debug instead

By default, CatAsk runs on this address: 127.0.0.1:8000

Caddy

There is an example Caddyfile available that runs CatAsk on catask.localhost by reverse proxying it to 127.0.0.1:5000, you can modify it as needed: Caddyfile

Updating

For instructions with updating from one version to another, check Updating page
Check CHANGELOG.md file for release notes