Skip to main content

Advanced installation (Docker isolation)

caution

This document explains the installation procedure to run VIKTOR using Docker, which is not recommended for first-time users. Please follow the simple installation in case you are unsure.

Enterprise IT

If you want to use VIKTOR within an enterprise IT environment, please make sure that your machine meets all requirements. See the enterprise IT guide for more information. Please contact your IT department to verify that your machine meets all requirements.

If your machine does not meet all requirements you can consider using a remote development environment.

By using Docker, running the code in development will more closely resemble production, so the chance of encountering differences between development and production is smaller. We recommend Docker only for experienced developers, as setting up Docker for Windows is not always convenient and, depending on your company size, may require a paid subscription.

Prerequisites

Before you start the installation procedure, you can go through the following checklist to make sure your setup is ready for installation:

  • Machine should run on Windows 10 Home/Pro/Enterprise or Linux.

  • Python (64-bit); the programming language used by VIKTOR.

  • You will need personal VIKTOR credentials (try for free!).

  • Virtualization needs to be turned on on your machine.
    Go to Task manager → Performance and see if "Virtualization" is enabled.

    docker-bios-virtualization

caution

If enabling of "Virtualization" is not allowed, it must be enabled in the BIOS of the machine first. In the BIOS, enable “Virtualization Technology (VTx)” (location and name may vary per machine) to do so. Please contact your IT department if you don't have the necessary permissions to make adjustments in your BIOS.

What will I install?

In order to use the VIKTOR platform, you need to install the following tools:

  • Docker: software used by the CLI to run your app code in an isolated 'container' in the background.
  • CLI: VIKTOR's command-line interface (CLI) is required to interact with your app.

Installing Docker

Linux

If you are using Linux, Docker can be installed using the package manager.

There are two ways to install / use Docker on Windows:

The benefits and drawbacks of running on WSL2 are listed below:

+ installation and starting an app is fast
+ installation of an app does not fail when deep dependency trees are present
+ WSL2 is available for Windows Home, whereas Hyper-V is not
- WSL2 is not supported on all Windows versions
- conceptually more complex due to the separate Linux filesystem and command-line interface
- setting up requires more time

We recommend to choose the default Hyper-V method and only choose WSL2 if you use Windows Home or you are experiencing issues during app development.

Estimated time: 1 hour
  1. Install Docker on your machine. When prompted, ensure "Enable Hyper-V Windows Features" is selected or "Install required Windows components for WSL 2" is deselected (options differ per installation version).

  2. Open the Docker settings and disable the checkbox to use the WSL2 based engine in the "General" section, if this isn't the case yet:

    docker-hyper-v-backend

  3. Make sure that you share your user folder (C:\Users\<username>). Allowing sharing of drives or folders (shared drives) is necessary when using Linux containers. If this was not done during the installation, you can set it in Docker → Settings → Resources → File Sharing.

  4. In the start menu, type “Turn Windows features on or off” (“Turn windows features on or off”) and make sure that Hyper-V is checked:

    docker-windows-features-hyper-v

  5. You can check all required Hyper-V features by running the systeminfo command in cmd.exe. All requirements should have a value "yes". If this is not the case, please visit the website of Microsoft for more information.

Installing the CLI

Estimated time: 15 min

The VIKTOR command-line interface (CLI) is required to interact with your app code (installing dependencies, starting the app, etc.). Choose the CLI for your specific operating system and installation method below:

note

Mozilla Firefox currently has a bug that removes the file extension when downloading files. Please use a different browser to download the CLI.

Using the CLI from any folder

If you want to use the CLI from any folder, the directory where the CLI resides must be added to the PATH environment variable (a variable that specifies the directories to be searched to find a command). Follow the instructions below to make the CLI available from any folder for your operating system.

The PATH variable is automatically set when using the Windows installer.

tip

We recommend to create a single folder on your hard-disk in which all your individual applications will be created, and give it an appropriate name (e.g. C:\Users\<username>\viktor-apps).

Right click on the created folder and pin to "Quick Access" to enable easy navigation to this folder.

CLI configuration

Next you'll need to set up the CLI. Open your command-line shell (Command Prompt in Windows) and enter the following command:

viktor-cli configure

The configure command opens a prompt that guides you through the configuration process. You can copy-paste in the command-line shell using a right-click of your mouse. You will need to enter the following information:

  1. Development environment. This is the environment that you will use while developing VIKTOR apps. The correct development environment is also stated in the invitation email you received when your account was created.
    • Free users: cloud.viktor.ai
    • Paid users: {company}.viktor.ai (substitute {company} with the name of your company)
  2. Email address used to create your VIKTOR account.
  3. Personal token. You can generate a token by logging in to your development environment. If you are logging in for the first time, use the link from the activation mail to generate a password to log in to the development environment. Alternatively, you can click "Forgot Password" to receive a mail to (re)set your password. Go to the settings page by clicking the three dots next to your name in the top-right corner and after that clicking 'Settings'. Select the 'Developer Account' tab and click the 'Generate new token' button. You can copy the token and paste it in the command-line shell with a right-click of your mouse and clicking 'Paste'.
  4. Select the default isolation mode venv (virtual environment) by pressing enter.
  5. Enter the path to your Python installation. If Python has been added to the PATH environment variable it will be inserted as a suggestion, select it by pressing enter.

System check

Run the following command to verify the installation:

viktor-cli check-system --docker

The check system command performs several checks. The conclusion of the checks are printed at the end of the message:

Starting VIKTOR system check...

V Operating system internet access
V Docker runs
V Docker using correct container
V Docker access to user directory
V Docker internet access
V Docker access to PyPI
V Docker access to VIKTOR domains

The system check has been completed with the following conclusions:

V Your system is ready to use VIKTOR with isolation mode 'docker'

If all checks succeeded, a "V" will be printed in front of Your system is ready to use VIKTOR with isolation mode 'docker'.

If any of the system checks fails, additional information can be printed to the command-line by using the --verbose flag as follows:

viktor-cli check-system --docker --verbose