Everything on WordPress is primed for a production server, and hardly mentions info on development stuff.

I want to setup a WordPress blog locally so that its good and ready before it goes live. Are there any specific guidelines when setting up a local WordPress development environment.

What is the easiest way of creating a wordpress blog locally but one that i can, at some point, transfer to a live server?

Question Edited for WordPress answers guidelines.

  • Perhaps when i mean development server i mean testing environment???
    – dom
    Oct 28, 2011 at 17:18
  • This is a localhost/server environment setup question, not a WordPress development question. Oct 28, 2011 at 19:22
  • What is the difference between a devlopment environment and a local server eonviroment??
    – dom
    Nov 1, 2011 at 18:00
  • Development environment vs. local server environment isn't the issue. Whichever term you use, the underlying question isn't in any way specific to WordPress or to WordPress core/Plugin/Theme development. Nov 1, 2011 at 18:07

5 Answers 5


WordPress local development environment:

Local development environments could apply to developing any type of application but there are some specific WordPress gotchas that could hinder your transition from local to dev.

The goal of a local development environment is to mimic as close as possible the production environment and allow seamless transition.

Matching URL If you plan on using the same database for production it's much easier to set your local dev to the same domain as production.

  • Open your host file: sudo nano /etc/hosts and add your-domain.com

Move root to sites dir It's much easier to manage your WordPress install under the sites dir than /Applications/Mamp/httdocs.

Edit your vhost file adding each site mapping it to the dir location:


<VirtualHost *:80>
DocumentRoot "/Users/your_name/Sites/domain"
ServerName domain.com #This should be the same as what was added to your host file

Edit your.conf files mapping your vhosts and enabling Macs built in Apache web server.


#Uncomment line 112:
LoadModule php5_module libexec/apache2/libphp5.so

#Change your directives line 247

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Allow from ALL

#Map your vhost file line: 621
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf


<Directory "/Users/yourname/Sites/">
     Options Indexes MultiViews
     AllowOverride All
     Order allow,deny
     Allow from All

Start your web server Go to system preferences -> sharing and check the web sharing box.

wp-config.php Map your database host location to Mamp:


Define local constants so you can use the same wp-config between dev and production:

if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) {
  include( dirname( __FILE__ ) . '/local-config.php' );
  define( 'WP_LOCAL_DEV', true ); 
} else {
  define( 'DB_NAME',     'production_db'       );
  define( 'DB_USER',     'production_user'     );
  define( 'DB_PASSWORD', 'production_password' );
  define( 'DB_HOST',     'production_db_host'  );

Now set you local db constants in local-config.php

Extra Tip: Use Mark Jaquith's Disable Plugins when doing dev plugin to define plugins to disable when on local. Put it in wp-content/mu-plugins and define the plugins to disable at the bottom of the file:

new CWS_Disable_Plugins_When_Local_Dev( array( 'vaultpress.php' ) );

Install WordPress It' much easier to manage installs using SVN (You will have to install the Subversion binaries for Mac first ).

When your ready for production export your db using phpmyadmin and move your files to the server.

mkdir /sites/domain-name  
cd /sites/domain-name  
svn co http://core.svn.wordpress.org/tags/3.2.1 .  

If you want an all-purpose local development stack where you can choose from different PHP, MySQL and Web server versions and are also not afraid of using Docker, you could go for the devilbox.

The devilbox is a modern and highly customisable dockerized PHP stack supporting full LAMP and MEAN and running on all major platforms. The main goal is to easily switch and combine any version required for local development. It supports an unlimited number of projects for which vhosts and DNS records are created automatically. Email catch-all and popular development tools will be at your service as well. Configuration is not necessary, as everything is pre-setup with mass virtual hosting.

The is also an article how to setup wordpress on the devilbox.

Getting it up and running is pretty straight-forward:

# Get the devilbox
$ git clone https://github.com/cytopia/devilbox
$ cd devilbox

# Create docker-compose environment file
$ cp env-example .env

# Edit your configuration
$ vim .env

# Start all containers
$ docker-compose up




There is a step-by-step LAMP guide here: http://ubuntulinuxhelp.com/how-to-install-a-web-server-and-more-in-ubuntu-linux/

After the install, then it's a simple matter of adding WordPress.


When you say "everything was fine", what do you mean? Did you manage to get WordPress up and running on the Ubuntu VM? How far did you get?

What files did you want to transfer? WordPress installation files? Or do you mean uploading files such as images for a post? The only time I've used an FTP server was when I needed to upload the WP installation files to a remote server. But if you're working on your local machine, you can either share a local folder to your virtual machine or download the files from the virtual machine and start the installation.

Regarding MAMP, never used it but there's some info about it on WordPress Codex and this article on Smashing Magazine could help.


Since noone has mentioned it yet: Local by Flywheel (https://local.getflywheel.com) is a very good and easy way to run your own local WordPress server.

I used to run my on AMP stack on my computer, but since I discovered Local I do all my development on that.

Not the answer you're looking for? Browse other questions tagged or ask your own question.