How to make a local version of a DigitalOcean server with Vagrant?

I have a site up and running on a DigitalOcean droplet and would like to make a local Vagrant box for development that mirrors that server as closely as possible. It looks like [I can't just download a droplet]( to use with Vagrant so I'm wondering what the best steps would be to do this.

I guess if I was starting from scratch I'd make a local Vagrant box (with Chef or something?) and *then* use all that to set up the live server in the same way. But, given I've already got the live server (which was set up rather manually, without Chef/Puppet/etc) what would be the best way to get everything set up as it should be, with as-similar-as-possible dev and live sites?

I've set up a Vagrant box before, but this stuff isn't my strong point and I have a hard time getting my head round it all.

2 thoughts on “How to make a local version of a DigitalOcean server with Vagrant?”

  1. Ideally you would have used configuration management, like Ansible (or puppet, chef, salt, cfengine, …), to setup your droplet. Then you could just run the same setup on your vagrant box.

    But take a look at `rsync` for copying files from the droplet.

  2. I had to do something similar. Basically I just started from scratch with my Linux distribution, then an AMP stack, and then I tried running my application. Naturally it broke in places so I just kept installing packages and fine tuning the AMP stack until I got working. I would version control the configuration script as I went along.

    I would use the –version flag on the server so I would know which version to install locally, eg.

    php –version

    Hope that helps!


Leave a Comment