Skip to content

Instantly share code, notes, and snippets.

@cuibonobo
Created July 16, 2014 18:09
Show Gist options
  • Save cuibonobo/2ae77309b1e420cde88d to your computer and use it in GitHub Desktop.
Save cuibonobo/2ae77309b1e420cde88d to your computer and use it in GitHub Desktop.
Creating a GitLab instance on a 512MB DigitalOcean droplet.

502 Bad Gateway Error

The quick fix is to run the following:

sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024k
sudo mkswap /swapfile
sudo swapon /swapfile

Your swapfile is now running and active, but to set it so that it's activated on each boot we need to edit /etc/fstab:

sudo nano /etc/fstab

Paste the following onto the bottom of the file:

/swapfile       none    swap    sw      0       0 

Now restart your VPS:

sudo restart

Wait a minute or two for your VPS to reboot, and then try GitLab again. If it doesn't work the first time, refresh the Bad Gateway page a couple of times, and you should soon see the GitLab login page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment