A while back I wrote a post about the dilemma of moving away from shared hosting to VPS (unmanaged) hosting and dealing with domain-specific email addresses.
I’ve been migrating a number of web sites to a “droplet” with Digital Ocean.
There are many benefits to this:
- Complete control over the environment – pick your own Linux distro, db engine, web server engine, PHP version, etc.
- Cost – For $10 on Digital Ocean, you get more RAM, CPU and storage than for most VPS servers for $30 or more.
- Flexibility – at Digital Ocean, you can spin up new “droplets” in about a minute, using a snapshot of a current droplet if you need to scale, etc.
I previously posted about using git to deploy to Ubuntu. However, that’s only relevant to me for my ”day job” where I can have some control over my server environment. For other work, I currently host a number of sites on Hostgator. I’ve fallen in love with the simplicity and power of deploying sites using Git (after the initial setup), so using Git in a shared hosting environment would be a huge win.
Luckily, I found a few resources out there on how to set this up, but in the end, the only real difference between my workflow for Ubuntu and hostgators turns out to be saving the Hosgator SSH port (2222) in a ~/.ssh/config file as described here.
- You must have SSH access on the domain you are working with. I believe it comes with your primary domain, and you have to pay $2(?) a month for SSH access per domain beyond that.
- It’s easier if you use the SSH public keys as described here.
- You can just create your bare Git repositories under /home/[username]/git if you want to set it up as I described in my previous post.