Installation Tutorial

GNUKhata consists of a Pyramid back-end, Vue front-end and PostgreSQL as database.

GNUKhata primarily supports docker based installation. GNUKhata front-end and back-end can be individually installed too.

Docker Installation

To install GNUKhata, following packages must be installed, - docker - docker-compose

Easy Installation

  • Download the installation script - install.sh
  • Change permission for the script chmod u+x install.sh
  • Run sh install.sh [path_to_configuration_file]
  • Configuration file is optional, the available configurations are here.
  • If you are making a custom configuration file, it should have VITE_GKCORE_URL mentioned in it. In most cases, for local install, the value for VITE_GKCORE_URL would be http://localhost:6543

Note: Since GNUKhata is currently under development, you will have to use following configurations to install the development version.

GKCORE_IMAGE=digitalfreedom/gkcore:devel
GKAPP_IMAGE=digitalfreedom/gkapp:devel

Manual Installation using Docker

  • Create and move to project directory - mkdir gnukhata && cd gnukhata
  • Download the build compose file, curl -O https://gitlab.com/gnukhata/build/-/raw/master/docker-compose.yml 1- Load the docker container - docker-compose --profile frontend up -d
  • To add configurations, add --env_file path_to_configuration_file to above command. Available configurations are listed here.
  • To stop running GNUKhata, run - docker-compose down

Manual Installation

  • Install dependencies.

    • PostgreSQL
    • Python Poetry
    • nodejs
  • Start postgresql - sudo systemctl start postgresql.service

  • Create database user and database. sh sudo -u postgres psql -c "CREATE USER gkadmin WITH PASSWORD <user name>;" sudo -u postgres psql -c "CREATE DATABASE <database name>;" sudo -u postgres psql -c "ALTER DATABASE <database name> OWNER TO <user name>;"
  • Clone gkcore and gkapp.
git clone https://gitlab.com/gnukhata/gkcore.git
git clone https://gitlab.com/gnukhata/gkapp.git
  • Update environment variables with database details. The available configurations will be found in env.sample in the gkcore repo. Copy the required configurations to .env file in gkcore repo.
  • Run pdm install.
  • Initialize database tables: gkdb --init.
  • Run migrations: gkdb --migrate
  • To serve the project, run gkserve. If you want development setup, run gkserve --development
  • Set VITE_GKCORE_URL environment variable with URL where backend is being served. Add the entry to .env inside gkapp repo.
  • Serve the front end: npm run dev

Windows installation

Windows installation is not well tested. Installing GNUKhata in windows may be buggy.

  • Install wsl
  • Install Debian: wsl --install -d Debian
  • Install Docker: sudo apt install docker.io
  • Follow instructions in the section "Manual Installation using Docker".

Note: More details about docker installation in windows, refer - https://docs.docker.com/desktop/setup/install/windows-install/


FAQ

How to Install Docker?

Debian/Ubuntu

  • sudo apt install docker.io docker-compose

Fedora

  • sudo dnf install docker-cli containerd docker-compose docker-compose-switch

Arch

  • sudo pacman -S docker docker-compose

How to fix Docker permission issues?

  • Create docker group. sudo groupadd docker
  • Add user to docker group. sudo usermod -aG docker $USER
  • Switch session to docker group. newgrp - docker
  • Run script/docker commands in the same terminal.
  • If you still get any errors, make sure the docker service is up and running. systemctl status docker.service
  • If docker is not running, start it using tthe following command: sudo systemctl start docker.service
  • If you want to avoid starting docker every time manually, enable the service to autostart on every login: sudo systemctl enable docker.service