Configuring the environment
Before you get started with the installation, you need to configure the environment variables. Create a.env file in the root directory of the project and add the following environment variables:
To enable desktop app support for self-hosted instances, make sure you’ve enabled subpath based access.
ENTERPRISE_LICENSE_KEY: The license key required to use Hoppscotch Enterprise.DATABASE_URL: This is where you add your Postgres database URL.HORIZONTAL_SCALING: Set to true to enable horizontal scaling, which uses Redis for managing pub-sub and state across instances.DATA_ENCRYPTION_KEY: A 32-character key used for encrypting sensitive data stored in the database.WHITELISTED_ORIGINS: URLs of Hoppscotch backend, admin dashboard, frontend app and the bundle server that are allowed to interact with the desktop app.VITE_BASE_URL: This is the URL where your deployment will be accessible from.VITE_SHORTCODE_BASE_URL: A URL to generate shortcodes for sharing, can be the same asVITE_BASE_URL.VITE_BACKEND_GQL_URL: The URL for GraphQL within the instance.VITE_BACKEND_WS_URL: The URL for WebSockets within the instance.VITE_BACKEND_API_URL: The URL for REST APIs within the instance.VITE_APP_TOS_LINKandVITE_APP_PRIVACY_POLICY_LINKare optional and are used to configure the links to the Terms & Conditions and Privacy Policy.HOPP_ALTERNATE_PORT: An optional variable that changes the HTTP port Caddy listens on inside the container, which is80by default. Set it to run under a non-root user, or when port80is already taken. See running under a non-root user.
Docker
Once the environment variables are configured, you may proceed to the next step of setting up the Hoppscotch instance. Currently, there are two ways to set up Hoppscotch:- Using individual containers for the services
- Using the AIO container
- Before proceeding further, ensure that you have a running instance of Postgres.
Using individual containers for the services
To self-host Hoppscotch Enterprise Edition, you will need the following services running via Docker:- Hoppscotch enterprise frontend
- Hoppscotch enterprise backend
- Hoppscotch enterprise admin dashboard
To enable desktop app support for your self-hosted Hoppscotch instance, make sure you expose the web app server which is a part of the frontend container. You can do this by running the following command:
PORT 3100 in the browser to setup and access the Hoppscotch instance.
Using the AIO container
The All-In-One (AIO) container is a single container that provides all the services required to run Hoppscotch. Pull the container from DockerHub with the following command:PORT 3100 in the browser to setup and access the Hoppscotch instance.
Subpath Based Access
To enable subpath based access the following.env variable must be set to true, it is set to false by default.
To enable desktop app support for your self-hosted Hoppscotch instance, make sure to set
ENABLE_SUBPATH_BASED_ACCESS to true in your .env file.Using individual containers for the services
When using the individual containers it is up to the users to configure a reverse proxy to allow requests made to a specific route to be rerouted to the relevant containers.Using the AIO container
When using AIO, when subpath access is set to true the services can be accessed from the following routesRunning under a non-root user
By default the images serve on port80 inside the container (the HTTP port Caddy binds), which a non-root user can’t bind since ports below 1024 are privileged. To run under a non-root UID — OpenShift’s restricted SCC, rootless Docker, Podman — set HOPP_ALTERNATE_PORT to a free port at or above 1024, run the container with GID 0, and update your published port mapping to match:
0 for you; just set the variable and point your Service and Route at the port you chose. If you deploy with the provided docker-compose.yml, the container side of the port mapping already follows HOPP_ALTERNATE_PORT.
The port must not collide with one the image already uses, or the container exits at startup naming the conflict. Port 9159 is the local proxy server, which the backend starts when LOCAL_PROXY_SERVER_ENABLE is true:
The container needs a writable root filesystem, and the non-root UID must belong to GID
0.Migrations
Once the instance of Hoppscotch is up, you need to run migrations on the database to ensure that it has the relevant tables. Depending on how Hoppscotch was set up, the method to run the migrations changes.Using individual containers for the services
Run the following command to copy the ID of the backend container:Using the AIO container
Run the following command to copy the ID of the AIO container:Running migrations
Once the respective container ID is copied, execute the following command to open an interactive shell within the AIO container to execute the migration command:.env file containing the right .env variables for the instance. Executing the aforementioned command will result in a shell being opened inside an instance of the container, following which the user can execute a database migration normally with
docker compose to run the services the following command can be used to open a shell inside the backend (or AIO) service.
ClickHouse setup
To start saving the audit logs into ClickHouse, first you need to create the relevant databases with the relevant tables in them. Follow the following instructions to set up ClickHouse to start saving logs:- Ensure that all the relevant containers are running.
-
Run the following command to get the ID of the ClickHouse container:
-
Once the ClickHouse container is also running, open an interactive bash into it using the
clickhouse-client: -
Once inside the container, execute the following SQL commands:
SAML Configuration
When you use SAML authentication, by default Hoppscotch only pulls the email of the user as the platform uses it as the unique identifier to verify the user. Starting fromv2024.9.2 onwards, Hoppscotch Enterprise Edition instances support pulling the following attributes from the SAML response to fill in additional user details:
displayName: The name of the user which is displayed within the Hoppscotch platform.photoURL: The URL where to find the user’s profile picture. Do not set this attribute if a profile picture doesn’t exist.isAdmin(optional): A boolean attribute (true or false) that automatically assigns the Admin role to users who belong to a designated group in the configured Identity Provider (e.g., Okta).
The
isAdmin attribute is evaluated only during the user’s first login or signup. Subsequent logins or signups will not re-evaluate this flag.
You have to configure your SAML IdP (Identity Provider) to include these attributes exactly in the response. For example, for Okta, you can follow this guide to configure the attributes.