MAMP development across computers via Dropbox

I use the following MAMP PRO setup for testing and development. It lets me sync data and host information across my computers, so that I have access to my local setup1 no matter where I’m working. This assumes some knowledge of basic UNIX commands, Terminal, and MAMP, and starts from scratch.

First, install and run MAMP on your primary computer. Verify that MySQL is running, and then stop the servers and quit MAMP.

In your Dropbox directory, create a directory called MAMP; this will hold all of MAMP-related files.
mkdir ~/Dropbox/MAMP

Move MySQL to Dropbox

Move your MAMP PRO db directory into your ~/Dropbox/MAMP directory.

You are moving databases! Backup your data first.

mv /Library/Application\ Support/appsolute/MAMP\ PRO/db ~/Dropbox/MAMP/

Symlink the previous location of the db directory to the new Dropbox location.

ln -s ~/Dropbox/MAMP/db /Library/Application\ Support/appsolute/MAMP\ PRO/db

Set up databases

Start MAMP and create a database in phpMyAdmin for each of your desired test servers.

Set up localhost

Create an htdocs folder in your MAMP directory for storing your localhost web site and set it up as the document root.

Set up hosts

Create a directory for each of your test domains in your MAMP directory, and add it as the document root for that host in MAMP PRO.

Set up name resolution

No need to do anything — MAMP PRO will handle changes to the hosts file for you when you start your servers.

If you are running Gas Mask, make sure that “Override external modifications” is not checked in Gas Mask > Preferences > General.

Make sure that Dropbox is synced completely, then stop the servers and quit MAMP.

Set up a secondary computer

Make sure that Dropbox has synced completely before beginning setup. Install and run MAMP; verify that MySQL is running, and then stop the servers and quit MAMP.

Remove the existing MAMP database directory.

You are removing databases! Anything here that is not backed up will be gone forever.

rm -rf /Library/Application\ Support/appsolute/MAMP\ PRO/db

Symlink the previous location of the db directory to the new Dropbox location.

ln -s ~/Dropbox/MAMP/db /Library/Application\ Support/appsolute/MAMP\ PRO/db

Start MAMP, start the servers, and verify in phpMyAdmin that you are looking at the correct set of databases.

Set up your hosts, pointing their document root at the existing Dropbox directories.

MAMP PRO should handle your name resolution.


  1. Running multiple concurrent instances of MAMP off the same database across Dropbox is bad, m’kay? Really bad. Don’t do it. 

6 thoughts on “MAMP development across computers via Dropbox

  1. This is an excellent tutorial. Thanks for posting! I appreciate that you’ve included the step for setting up additional computers, which other tutorials have omitted. Question – When setting up future (wordpress) installations in Mamp PRO on any of the computers, will the symlink write the database file to the dropbox folder so that it can be accessed by the other computers?

  2. Once you create the symlink on your second computer, it will use the same database tables that were created in Dropbox by your first computer (hence the warning about data being gone forever). Just don’t run concurrent sessions from different computers at the same time — bad things will happen. Since this is meant for local sandbox development I am not terribly concerned with absolute database integrity.

  3. I’ve tried this technique, but my MAMP (not PRO) doesn’t start the MySQL server… probably something related to Mac OS X Yosemite 🙁

Comments are closed.