Select Next: … until you get to the Configure Security Group page, then add the default HTTP rule (port range “80”, source “0.0.0.0/0, ::/0”)

Launch your instance, then navigate to the its public URL.

If you have configured a DNS entry for the IP, configure externalURL to reflect that. If externalURL has the HTTPS protocol then Sourcegraph will get a certificate via Let’s Encrypt. For more information or alternative methods view our documentation on TLS. (Note: externalURL was called appURL in Sourcegraph 2.13 and earlier.)

Substitute the path to your cloud-init.txt file, the name of your key pair, and an appropriate security group. To start you probably want a security group which exposes port 80 and 22 (for SSH) to the public internet.

Update your Sourcegraph version

To update to the most recent version of Sourcegraph (X.Y.Z), SSH into your instance and run the following:

Sourcegraph instances created before July 30, 2018

The below sections only pertain to Sourcegraph instances created using this tutorial before July 30, 2018.

This applies to you if you see the following warning on the Site admin > Code intelligence page:

Language server management capabilities disabled because /var/run/docker.sock was not found.

Option A: Continue using manual code intelligence installation

Just as before July 30, 2018, you can continue manually managing code intelligence for your Sourcegraph instance if you prefer. The instructions for this have moved here.

Option B (recommended): Upgrade to the new automatic code intelligence

Instead of manually managing code intelligence, you can upgrade to the new automatic code intelligence method.

This allows Sourcegraph to automatically set up language servers for you when new repositories are added with languages we support, in addition to allowing you (the site admin) to manage (or explicitly disable) running language servers, view their health, etc. from within the application UI on the Site admin > Code intelligence page.

To upgrade your existing instance to use automatic code intelligence, SSH into your Sourcegraph instance and run the following:

docker stop $SOURCEGRAPH_CONTAINER_NAME (find the container name using docker ps).

Start the Docker container again using the new docker run command provided in the updated user-data #cloud-config script above. i.e.:

These steps only need to be performed once, and they will persist across machine restarts.

After performing these steps, you will now have automatic code intelligence! To verify, go to the Site admin > Code intelligence page and confirm that you see Enable/Disable/restart buttons next to each language server.