NOTE: On Mac/Windows, if trying to connect to a PostgreSQL server on the same host machine, remember that Sourcegraph is running inside a Docker container inside of the Docker virtual machine. You may need to specify your actual machine IP address and not localhost or 127.0.0.1 as that refers to the Docker VM itself.

Using your own Redis server

Generally, there is no reason to do this as Sourcegraph only stores ephemeral cache and session data in Redis. However, if you want to use an external Redis server with Sourcegraph, you can:

Simply add the REDIS_ENDPOINT environment variable to your docker run command and Sourcegraph will use that Redis server instead of its built-in one. For example:

NOTE: On Mac/Windows, if trying to connect to a Redis server on the same host machine, remember that Sourcegraph is running inside a Docker container inside of the Docker virtual machine. You may need to specify your actual machine IP address and not localhost or 127.0.0.1 as that refers to the Docker VM itself.