How to Set Up WordPress for Local Development in Linux

WordPress has evolved into a CMS for most sites on the Internet. Although you can pay hosting companies to keep your WordPress site on their servers, this is only the best option for a website that can be used in a production environment. If all you have to do is experiment and get familiar with CMS, or want to start developing plugins / themes for WordPress, you can set up everything you need for XAMPP, as well as WordPress itself on a Linux computer, to learn, develop or hang around, and No need to pay a penny.

Install XAMPP

We will follow the simple method of using XAMPP installer by ApacheFriends, which will install the installation of Apache, MariaDB, PHP to the next and next step.

Access Apache friends Website and download the latest “XAMPP for Linux” installer.

2. Since we are in the download phase, please also visit Bitnami’s website and download the latest version WordPress installer for Linux.

3. Open a terminal and go to the directory where you downloaded the two files, as shown below:

cd Downloads

Make these two files executable:

chmod +x xampp-*-installer.run
chmod +x bitnami-wordpress*-installer.run

Linux Local Wp Xampp Installer

4. Run the Apache installer with the following command:

sudo ./xampp-*-installer.run

5. Accept the default settings and click Next> on each screen of the installation to complete the process. When done, enable “Start XAMPP” and click “Finish”.

Linux Local Wp Launch Xampp

6. In the window that appears, on the Welcome tab, click Open Application Folder, and then minimize the pop-up file manager window. We will need it later, so please do not close it.

7. Go to the “Manage Server” tab and make sure that both MySQL and Apache Web Server are running. If not, select them and click Start in the upper right corner. You don’t need a ProFTPD server because you can access all files locally, so you can leave it as “Stopped”.

Linux local Wp boot server

8. Check if everything works by launching your favorite browser and accessing “localhost” as the address. The XAMPP welcome page should appear.

Linux local Wp test Apache

note: To start the stack in the future, use the following command:

sudo /opt/lampp/lampp start

If you wish to start and stop a single server via the provided GUI:

cd /opt/lampp
sudo ./manager-linux.run

If you use a 64-bit installation, the second command will be:

sudo ./manager-linux-x64.run

Install WordPress

1. After the XAMPP stack is up and running, continue to install Bitnami’s WordPress. Run it with:

sudo ./bitnami-wordpress*-installer.run

2. Click Next, leave the default installation folder, and pause on the Create Administrator Account screen. Enter the account details you want to use to sign in to your upcoming WordPress installation. If you have been to this point, leave the “MySQL Password” box blank = the default XAMPP password is blank.

Linux Local Wp Settings Wp

3. The installer will also give you an option to change the pre-selected (and overly generic) blog name. If you plan to turn it into an actual site hosted on a real server and accessible to others, it is recommended that you enter a name to use instead of a temporary name. This will help minimize MySQL find and replace operations when moving the site to a remote host.

Linux Local Wp Blog Name

4. Since everything will happen locally, you don’t need to “receive notifications about site status.” You can now skip the “Configure SMTP Settings” tab and mail support.

Linux local Wp skip mail

5. On the “Installation Type” tab, select “Development Settings” instead of “Production Settings” because you are setting up a development environment / playground, not a website that is ready.

Linux local Wp development settings

6. For the same reasons not related to the final site, deselect “Launch wordpress in the cloud with Bitnami”.

Linux Local Wp Disable Deployment

7. Click “Next” to continue Bitnami’s WordPress installation. When you are done, test it as before, but this time use the local WordPress URL: localhost / wordpress.

Your blog’s welcome screen should be displayed using the WordPress default theme and settings.

Linux Local Wp Test Wp

Now that you have WordPress installed locally and it works, to log in to the admin console, go to the URL: localhost / wordpress / wp-login.php.

Linux Local Wp Blog Dashboard

XAMPP alternatives

Finally, if you want to have complete control over all aspects of the installation, you can take a completely manual approach. You can install Apache, PHP and MySQL or other alternative methods, configure them separately, then download and install WordPress yourself. This way, you will also become more familiar with the technologies that support WordPress.

The reason we chose the simple way (XAMPP) is that most people who just want to use WordPress may not care about “extra features”. They would rather avoid dealing with them unless it is really needed.

If you want to go a middle way between the completely simple way of XAMPP and Bitnami WP modules and turning your PC into a full LAMP server, Install WordPress via Docker. It is much more complicated than the method we studied, but it retains all the virtualization features without having to install other services on the actual operating system, which brings additional benefits.

The difference is that XAMPP installs the necessary “infrastructure” for WordPress (Apache, PHP and MySQL), which is equivalent to a “stand-alone application” in the OS, while Docker keeps everything in a virtualized “working environment” with all dependencies in.

However, Docker still relies on the “native” element of the operating system, adding “missing dependencies on top” for WordPress. For a large team that collaborates on a common project, its members will benefit from accessing the same server but each member will benefit from local access, Vagrant & VirtualBox installation Probably the best option.

Note, however, that complete virtual environments also contain complete operating system files, so they are also larger and difficult to maintain because they require that you keep both the host and the virtualized operating system up to date. Therefore, for ordinary single users with personal blogs, we don’t consider them the best choice, and professional developers and teams that collaborate on large projects are not the best choice.

Ranch
                        
                    
                    Ranch

Sidebar