Skip to content

Installation Guide

Ronan LE MEILLAT edited this page Jun 16, 2024 · 4 revisions

How to Build Manually

If you prefer not to use Docker, you can build and run the SctgDesk Server manually on your system. Follow the steps below to get started:

Prerequisites

Ensure that you have the following installed on your system:

  • Rust: Follow the instructions on rust-lang.org to install Rust.
  • Git: Ensure you have Git installed. You can download it from git-scm.com.
  • on windows only: You need to have a working Microsoft Visual C++ 2022 installation and Sqlite3 libraries installed.

Cloning the Repository

First, clone the SctgDesk Server repository:

git clone https://github.com/sctg-development/sctgdesk-server.git
cd sctgdesk-server

Building the Server

Once you have cloned the repository, navigate to the project directory and build the server using Cargo (the Rust package manager):

  • on unices:
DATABASE_URL=sqlite://$(pwd)/db_v2.sqlite3 && cargo build --release
  • on windows:
set "DATABASE_URL=sqlite://%CD%/db_v2.sqlite3" && cargo build --release

Note: the DATABASE_URL environment variable is used during the compilation process for checking the validity off each SQL request. So you need to have at least a valid empty database during building. You can use the db provided in the repository?

Docker

Docker installation

Windows

Prerequisites

  • Make sure your Windows system supports Hyper-V and Containers Windows features.
  • Download the Docker Desktop installer from the Docker Hub.

Steps to Install Docker

  1. Run the Docker Desktop Installer: Once downloaded, double-click Docker Desktop Installer.exe to run the installer.
  2. Follow the Install Wizard: Accept the defaults and authorize the Docker Desktop Installer with your system password during the install process.
  3. Complete the Installation: Click Finish on the setup complete dialog and launch the Docker Desktop application.

Verify Docker Installation

  • Open a terminal window (Command Prompt or PowerShell, but not PowerShell ISE).
  • Run docker --version to ensure that you have a supported version of Docker.
  • Run docker run hello-world to verify that Docker can pull and run images.

Install Docker Compose

  • Docker Compose on Windows is included as part of the Docker Desktop install. Verify the installation by running docker-compose --version in the terminal.

MacOS

Prerequisites

  • Make sure your system is running macOS Sierra 10.12 or newer.
  • Download the Docker Desktop installer from the Docker Hub.

Steps to Install Docker

  1. Run the Docker Desktop Installer: Once downloaded, double-click Docker.dmg to open the installer, then drag the Docker icon to the Applications folder.
  2. Open Docker Desktop: Open Docker.app from the Applications folder. You'll see a whale icon in the top status bar indicating that Docker Desktop is running.
  3. Complete the Installation: Follow the on-screen instructions to complete the installation.

Verify Docker Installation

  • Open a terminal window.
  • Run docker --version to ensure that you have a supported version of Docker.
  • Run docker run hello-world to verify that Docker can pull and run images.

Install Docker Compose

  • Docker Compose on macOS is included as part of the Docker Desktop install. Verify the installation by running docker-compose --version in the terminal.

Ubuntu 22.04 LTS (and other Debian based distros)

Prerequisites

  • Make sure your system is running Ubuntu 22.04 LTS.
  • Update your existing list of packages: sudo apt update.

Steps to Install Docker

  1. Install Docker: Run sudo apt install docker.io.
  2. Start and Automate Docker: Start Docker using sudo systemctl start docker and automate Docker at boot by running sudo systemctl enable docker.

Verify Docker Installation

  • Run docker --version to ensure that you have a supported version of Docker.
  • Run docker run hello-world to verify that Docker can pull and run images.

Install Docker Compose

  1. Download Docker Compose: Run sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose.
  2. Apply executable permissions to the binary: sudo chmod +x /usr/local/bin/docker-compose.

Verify Docker Compose Installation

  • Run docker-compose --version to check if the installation was successful.

Running the Docker Image

Running the Sctgdesk-server stack is straightforward using Docker Compose. Follow these steps to get it up and running:

  1. Fetch the Docker Compose File: Clone the repository or download the docker-compose.yml file directly.

  2. Edit the Docker Compose File: Open the docker-compose.yml file in a text editor. Locate the DNS names for your server within the file and replace them with the correct values.

  3. Launch the Docker Stack: Navigate to the directory containing your modified docker-compose.yml file. Run the following command to start the Docker stack:

    docker-compose up

By following these steps, you should have a working Sctgdesk-server stack running on your machine.