How to Install the Local Preview Gitpod Self-Hosted
Note: Currently, this Local Preview of Gitpod Self-Hosted is in alpha. It does not work on Macs with Apple Silicon (e.g. M1). See the relevant issue for more information.
The Local Preview of Gitpod Self-Hosted is the easiest way to try out Gitpod locally without having to spin up a Kubernetes cluster - allowing you to try Gitpod Self-Hosted locally with minimal effort and resource requirements. As a result, this is not intended for production usage. Please refer to the Getting Started page for instructions on how to install Gitpod for continuous usage.
This install method runs a K3s cluster inside a Docker container. Self-signed certificates are automatically created and a Gitpod instance using these certificates will be installed into the k3s cluster. See our TLS page for more information about Gitpod and certificates.
1. Running the Docker container
First, Create a volume to which the Gitpod container will attach:
docker volume create gitpodRun the following command to get the local-preview Docker container up and running:
docker run -p 443:443 --privileged --name gitpod --rm -it -v gitpod:/var/gitpod eu.gcr.io/gitpod-core-dev/build/local-previewUnpacking the above command:
- -p 443:443to map the- 443container port to host.
- --privilegedto be able to run docker (and hence- k3s) inside the container. This is necessary.
- --name gitpodto set the name of the docker container for further access.
- --rmto delete the Docker container after stopping.
- gitpod:/var/gitpodto store the workspace files, etc into the- gitpodvolume.
Note: By default,
127-0-0-1.nip.iois the DOMAIN to access Gitpod. To use another host network IP Address, theDOMAINenvironment can be set accordingly via an-eflag in the above command. This is useful to share access to the Gitpod Self-Hosted instance running on your machine within your local network. For Example,192.168.0.42Host Network IP would be192-168-0-42.nip.io, set by appending-e DOMAIN=192-168-0-42.nip.io.
2. Accessing Gitpod
As this is a self-signed instance of Gitpod, the Gitpod root CA cert has to be imported into your browser manually to access the full functionality of Gitpod. The certificate can be retrieved by running the following:
docker cp gitpod:/var/gitpod/gitpod-ca.crt $HOME/gitpod-ca.crtThis certificate is saved at $HOME/gitpod-ca.crt and can then be loaded into your browser. Most browsers also require a restart before they can start to use the imported certificate.
Once the certificate is loaded, the URL to access the Gitpod instance would be https://127-0-0-1.nip.io unless the DOMAIN environment is overridden in which case the same has to be used.
The first screen you see will ask you to configure a Git integration, which will also serve as the way that you and your users authenticate against Gitpod. You can find out more in the integrations section.
Important: Public (SaaS) Source Control Management Systems (SCMs) (i.e. GitLab.com, GitHub.com and Bitbucket.org) are not integrated by default with a Self-Hosted Gitpod instance because OAuth apps are tied to domains. Therefore, these public SCMs need to be integrated manually with an OAuth application you specifically create for your domain. This is done similarly to how it is done for the private/self-hosted versions of each SCM. As such their respective guides also apply here:
- Follow these steps to integrateGitLab.comwith your self-hosted Gitpod instance. You will need to entergitlab.comas theProvider Host Namein the New Git Integration Modal.
- Follow these steps to integrateGitHub.comwith your self-hosted Gitpod instance. You will need to entergithub.comas theProvider Host Namein the New Git Integration Modal.
- Follow these steps to integrateBitbucket.orgwith your self-hosted Gitpod instance. SelectBitbucketas theProvider Typein the New Git Integration Modal. For bitbucket.org this requires configuring an “OAuth consumer” on a “workspace”. This is slightly different from the documented Bitbucket Server integration. See gitpod PR #9894 for an example.
Note: Your first workspace start can take a bit of time because the workspace image first needs to be built and then downloaded. Subsequent workspace starts should be much quicker.