Install Sourcegraph with Docker

It takes less than 5 minutes to install Sourcegraph using Docker. If you’ve got Docker installed, you’re ready to start the server which listens on port 7080 by default.

docker run --publish 7080:7080 --publish 2633:2633 --rm --volume ~/.sourcegraph/config:/etc/sourcegraph --volume ~/.sourcegraph/data:/var/opt/sourcegraph sourcegraph/server:3.2.0

Access the server on port 7080, then the below screencast will show you how to configure Sourcegraph to search public and private repositories, and enable code intelligence on Sourcegraph and GitHub.com.

Once Sourcegraph has been configured, head to the site administration documentation for next steps.

Cloud installation guides

Cloud specific Sourcegraph installation guides for AWS, Google Cloud and Digital Ocean.

File system performance on Docker for Mac

There is a known issue in Docker for Mac that causes slower than expected file system performance on volume mounts, which impacts the performance of search and cloning.

To achieve better performance, you can do any of the following:

  • For better clone performance, clone the repository on your host machine and then add it to Sourcegraph Server.
  • Try adding the :delegated suffix the data volume mount. Learn more. --volume ~/.sourcegraph/data:/var/opt/sourcegraph:delegated

Next steps