This detailed tutorial explains what is LocalWP, benefits of using LocalWP, how to install LocalWP to deploy and setup local WordPress development environment in Linux and Unix-like operating systems.
If you're WordPress developer, you will have a few options to deploy and setup WordPress websites.
You could directly build and work on the live site. But it is NOT RECOMMENDED and dangerous. You can create a staging site and deploy, test the wordpress installations before pushing them into production.
The another recommenced way is setup a local WordPress development environment to deploy wordpress sites on your local system. This is the safest way to do all sorts of wordpress testing.
From the local WordPress development site, you can test various plugins and customize the site as the way you want it. If you're a beginner, you also use the local wordpress development environment for learning purposes as well.
Also setting up multiple WordPress sites on LAMP/LEMP stack is not so convenient and time-consuming task.
The easiest, quickest and probably the best way to setup development environment for WordPress is by using a tool named LocalWP.
2. What is LocalWP?
LocalWP, or just Local, is an application to deploy and develop wordpress sites locally.
You don't need to manually install web server (Apache or Nginx), database server (E.g. MySQL), and PHP. Local takes care of everything!
Using Local, you can easily install WordPress on your system and create as many as wordpress sites you want with a couple mouse clicks!
Local allows you to effortlessly setup single or multi-site WordPress installation. If everything works as the way you expected, you can push your local site to live.
You can clone your site, and even backup your site files to cloud storages such as Google drive or Dropbox.
Local is created by Flywheel, a company that provides affordable managed wordpress hosting. Local supports Linux, macOS and Windows platforms. It is completely free to use!
3. LocalWP features
Local has everything you need to install WordPress, develop wordpress sites, and troubleshoot sites on your local system.
Here is the list of benefits of using Local on your system:
- One-click automatic wordpress installation.
- Single and multi-site wordpress installation.
- Support for both subdomain and subdirectory installations.
- SSL support. Self-signed certificates are automatically created for new sites.
- Local gives you the ability to SSH into your Local wordpress sites.
- Includes WP-CLI, the command-line interface to manage wordpress sites from command line.
- Push and pull Local wordpress sites to Flywheel or WP Engine.
- Create live links to your wordpress sites, so your client or colleagues can access and test the sites from anywhere.
- No need to create and manage multiple user. Local one-click admin feature allows you to access the WP admin page with just one click!
- Hot-swap environments. You can instantly switch to different versions of Apache or Nginx, MySQL and PHP. You can even switch to different webserver, for example Apache to Nginx and Vice versa.
- Backup site files to Google drive and Dropbox.
- Create blueprint of a site to re-use it later.
- Import and export site files, databases, configuration files, log files, and Local settings.
- Test outgoing email with MailHog
- Enhance your local site with tools like Image Optimizer, Link Checker and Instant Reload.
- Cross-platform support.
- Completely FREE to use!
4. Install LocalWP in Linux
As stated already, Local can be installed in Linux, macOS and Microsoft Windows operating systems.
Go to LocalWP website and click the Download button. A new pop-up window will open. Choose your operating system type and fill up the other details such as your name and Email id and click Get it now button.
Go to the download location and install it using your distribution's package manager. I downloaded the
.rpm file, so I installed LocalWP using
rpm command like below:
$ sudo rpm -Uvh local-6.0.0-linux.rpm
If you downloaded the
.deb file, you can install it using using
$ sudo dpkg -i local-6.0.0-linux.deb
$ sudo apt install -f
Alternatively, you can do:
$ sudo apt install ./local-6.0.0-linux.deb
This will install all the necessary dependencies in one go. Thanks Motlke for this tip.
5. Setup local WordPress development environment in Linux using LocalWP
Launch Local from Menu or Dash. It will be usually found under "Programming" section in your application menu.
You will be prompted to create a new account in LocalWP. It is required to backup files to cloud and create live links, so create account if you don't have one already.
You will be redirected to LocalWP website. Follow the on-screen steps to create a new account.
Once the account is created, close the browser window and go back to the Local application dashboard window.
This is how your Local dashboard looks like:
There are many options to choose from. You can create a new WordPress site, or connect to managed hosting services or change your settings and preferences. First, let us start from creating a new WordPress site.
5.1. Create new wordpress in Local
Click the "CREATE A NEW SITE" button or click the plus (+) sign on the bottom left corner to create a new wordpress site in Local.
Enter the WordPress site's name. A new domain URL for your WordPress will be automatically generated. You can view it under the Advanced options section. By default, all Local sites will have an
.local extension. You can change it if you want to.
You can also view the path of your site in Local site path section. By default, it will be saved in a directory named
"Local Sites" in your
$HOME directory. If you're okay with the default options, click Continue.
Next choose your environment. Here, you will be given two options, namely Preferred and Custom.
You can choose the Preferred option to use a set of recommended tools for your Local site. Local will automatically choose Nginx, PHP and latest MySQL version if you select Preferred option.
Alternatively, you can choose the Custom option to select the tools of your choice.
Once you made the selection, click Continue.
Next enter the administrative user name for your WordPress site, password and the Email. Under Advanced options, you can choose if you want this installation to be a multisite.
After a few minutes, you will see the newly installed WordPress site is listed in the Local dashboard, along with all its information.
Congratulations! You just installed WordPress using Local in your Linux machine!
You can click the "OPEN SITE" button to view how your new WordPress looks like!
It is time to work on the newly created wordpress site!
5.2. Access WordPress site admin dashboard
From the Local dashboard, Click the Admin button:
Your wordpress site's login page will open in a new browser window. Enter the admin user and its password to login to WP admin page.
Start working on your new WordPress site!
5.3. Configure WordPress settings
In the Local dashboard, you will see the following tabs to configure and tweak various settings.
The Overview section displays the details of your WordPress site. Here, you can find your wordpress site URL, web server (Apache or Nginx), PHP and MySQL versions, WordPress version and the option to enable self-signed SSL certificate.
In the Database section, you will see the option to connect to Adminer management tool, database name, database user name and password.
From the Utilities section, you can configure configure and test outbound E-mail.
The last section is Tools the section where you will find the Live link URL and the username and password to access the live link.
5.4. Enable Live link
One of the best feature of Local is Live Link. It will convert your locally-built wordpress site into a shareable test environment, so any authorized person will able to access the Local site from anywhere. This comes in handy when you want to show your local site to your clients.
To create a live link for your local site, click Enable button in the bottom of the Local dashboard.
Once you enabled the Live Link option, a publicly accessible URL will be generated. Also the shareable link is protected with an username and password.
You can view view the details of the link and credentials by clicking on the Live Link button or under the Tools section.
Just send this URL along with the username and password to your clients. They can access your Local site from anywhere using the shared URL.
Please note that the live links are viewable only when your computer is turned on and connected to Internet.
5.5. Access Adminer dashboard
Adminier is a web-based database management tool. LocalWP includes it to make the database management easier.
To launch Adminer, click "OPEN ADMINER" button under the Database section from your Local dashboard.
The Adminer dashboard will open in a new browser window.
Here, you can view, configure and manage databases.
By default, Local will create database named "local". You can check all table content of the database and play around with running SQL queries from Adminer.
When you create a new WordPress site, you will probably face the following error in Fedora.
Error: Command failed: /opt/Local/resources/extraResources/lightning-services/php-7.3.5+10/bin/linux/bin/php /opt/Local/resources/extraResources/bin/wp-cli/wp-cli.phar --path=/home/sk/Local Sites/ostechnix-testing-site/app/public --require=/opt/Local/resources/extraResources/bin/wp-cli/local-wpcli-error-reporting.php core config --skip-check --dbname=local --dbuser=root --dbpass=root --skip-salts /opt/Local/resources/extraResources/lightning-services/php-7.3.5+10/bin/linux/bin/php-original: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory
If you encounter with
error while loading shared libraries: libnettle.so.6 while creating new sites, you need to download the exact missing library and move it to your
In my case, the missing library is
libnettle.so.6, so I fixed it as described in this link.
Close the Local application and run the following commands one by one:
$ cd ~/Downloads
$ sudo dnf install wget
$ wget https://kojipkgs.fedoraproject.org//packages/nettle/3.4.1rc1/3.fc31/x86_64/nettle-3.4.1rc1-3.fc31.x86_64.rpm
$ rpm2cpio nettle-3.4.1rc1-3.fc31.x86_64.rpm | cpio -idmv
$ sudo cp usr/lib64/libhogweed.so.4 /usr/lib64/
$ sudo cp usr/lib64/libnettle.so.6 /usr/lib64/
Now open Local and try to create new site. It should work now.
In this guide, we discussed what is LocalWP, and how to install wordpress using LocalWP in Linux. Setting up Local wordpress development environment gives you a safer and stress-free development experience. Using Local, you can deploy, build and test single or multiple WordPress sites faster in your local system.