| Deployment Type | Suggested for | Setup time | Multi-machine? | Auto healing? | Monitoring? |
|---|---|---|---|---|---|
| Single-container server | Local testing | 60 seconds | Impossible | No | No |
| Docker Compose | Small & medium production deployments | 5 minutes | Possible | No | Yes |
| Kubernetes | Medium & large highly-available cluster deployments | 30 minutes | Easily | Yes | Yes |
- If you're just starting out, we recommend running Sourcegraph locally. It takes only a few minutes and lets you try out all of the features.
- If you want to migrate from the single-container server (
sourcegraph/server) to the Docker Compose deployment, refer to this migration guide. - If you need scalability and high-availability beyond what a single-node Docker Compose can offer, use the Kubernetes cluster deployment option, instead.
It takes less than 5 minutes to run and install Sourcegraph using Docker Compose:
git clone git@github.com:sourcegraph/deploy-sourcegraph-docker.git
cd deploy-sourcegraph-docker/docker-compose
git checkout v3.16.0
docker-compose up -dOnce the server is ready (the sourcegraph-frontend-0 service is healthy when running docker ps), navigate to the hostname or IP address on port 80. Create the admin account, then you'll be guided through setting up Sourcegraph for code searching and navigation.
For next steps and further configuration options, visit the site administration documentation.
NOTE: If you get stuck or need help, file an issue, tweet (@srcgraph) or email.
We strongly recommend that you create your own fork of sourcegraph/deploy-sourcegraph-docker to track customizations to the Sourcegraph Docker Compose yaml. This will make upgrades far easier.
-
Fork sourcegraph/deploy-sourcegraph-docker
- The fork can be public unless you plan to store secrets (SSL certificates, external Postgres credentials, etc.) in the repository itself.
-
Create a
releasebranch (to track all of your customizations to Sourcegraph. When you upgrade Sourcegraph's Docker Compose definition, you will merge upstream into this branch.
SOURCEGRAPH_VERSION="v3.16.0"
git checkout $SOURCEGRAPH_VERSION -b release- Commit customizations to the Sourcegraph Docker Compose yaml to your
releasebranch
The Sourcegraph Docker Compose definition uses Docker volumes to store its data. These volumes are stored at /var/lib/docker/volumes by default on Linux.
Use the resource estimator to find a good starting point for your deployment.
Cloud specific Sourcegraph installation guides for AWS, Google Cloud and Digital Ocean.
- Install Sourcegraph with Docker Compose on AWS
- Install Sourcegraph with Docker Compose on Google Cloud
- Install Sourcegraph with Docker Compose on DigitalOcean
To test new development builds of Sourcegraph (triggered by commits to master), change the all semver tags in docker-compose.yaml from 3.14.2 to insiders.
WARNING:
insidersbuilds may be unstable, so back up Sourcegraph's data and config beforehand.
To keep this up to date, run docker-compose pull to pull in the latest images, and run docker-compose restart to restart all container to access new changes.