You decide which services we may enable for analytics, personalization, and external content.
We use cookies and similar technologies on our website to personalize content, embed external media, and better understand how individual areas are used.
Necessary cookies
These entries support essential functions such as security, stability, and form processing.
Optional sections
AnalyticsMarketingPersonalizationExternal media
Your data may be processed with your consent or on the basis of legitimate interests. In the cookie settings, you can reject or explicitly allow each optional category.
Some services process personal data in third countries. By consenting, you also agree to this transfer. You can find more information in our Privacy Policy.
You can reopen and change your selection at any time. · 1.0.2
Set Up WordPress on a Linux Server – Start Your Own Website or Blog
Discover how to install WordPress on a Linux server with the LAMP stack to efficiently create and manage your website → Learn more now
10 November 20267 min read0 Views0 helpful
Introduction
WordPress is a popular web content management system used to manage and publish websites. Today, WordPress has expanded into many other areas such as mailing, forums, shops, and much more. This is supported by an active community that has built a strong plugin ecosystem and templates, making it easy for end users to set up almost anything. In this guide, we show you how to install the WordPress CMS on a Linux server.
FAQ
Frequently asked questions
You can install WordPress directly via One-Click Apps in the dashboard of your dedicated server by searching for WordPress in the app catalog and starting the installation with your preferred project, environment, and domain settings.
The guide uses the LAMP stack: Linux, Apache as the web server, MySQL as the database, and PHP as the core dependency, demonstrated on Ubuntu.
Connect to your server via SSH and first run the command sudo apt update before installing the necessary dependencies.
Feedback
Was this article helpful?
Your feedback helps us prioritize and improve content.
0 of 0 Users found this article helpful.
Personal support
Need more help than the guide provides?
Our ZAP support team knows your product — briefly describe your issue and we'll help you personally.
Navigation
Software
Installing WordPress with One-Click Apps
You can install WordPress directly via One-Click Apps in the dashboard of your dedicated server. After the initial setup of the apps, open the app catalog, search for WordPress, and start the installation with your preferred project, environment, and domain settings. This allows you to deploy and manage WordPress quickly and user-friendly without manually working via the command line – while still benefiting from integrated web management, support for custom domains, and SSL certificates where available.
Preparation
First, connect to your server via SSH. If you don’t know how to do this, check out our First Access (SSH) guide.
Info
In this guide, we use the Ubuntu distribution combined with Apache as the web server, MySQL as the database, and PHP as the core dependency. This is called the LAMP stack: Linux, Apache, MySQL, and PHP.
Once logged in, start with the update command.
Code
sudo apt update
Then you can install all necessary dependencies. Simply copy the entire command below and paste it to install everything at once. Be patient, this may take a while.
After the dependencies are installed, there are a few recommended steps to ensure all core components of the LAMP stack are working.
Apache & Firewall
First, you need to configure the firewall so that the Apache web server can communicate with the internet and function properly. It’s important to create the appropriate firewall rules so the web server is accessible from outside.
In this example, we use the UFW firewall because Apache has a registered application profile for it. If you use a different firewall, make sure port 80 (HTTP) is open. Learn more about firewalls on Linux in our Manage Firewall guide.
Make sure the UFW firewall is enabled and that a rule for SSH exists.
Make sure you have set up an SSH rule if you use UFW! Without this, you won’t be able to log in via SSH after losing connection!
Now create the rule for Apache and then check if the rules are present.
Code
# Create rule for Apache
sudo ufw allow in "Apache Full"
# Show UFW firewall rules
sudo ufw status
Tip
Use the command ufw app list to see which profiles are available. In the example above, Apache Full opens both HTTP (port 80) and HTTPS (port 443).
You should see Apache and Apache (v6) with the action ALLOW, confirming the firewall is ready. You will also see other rules you set up earlier, including the SSH rule.
After opening the firewall for Apache, make sure Apache is running. To do this, open your server’s IP address in a browser: http://[your_ip_address]
If everything is working, you will see a default welcome page. If not, check the service status with: systemctl status apache2
MySQL Setup
Next, perform the initial setup of MySQL. It is recommended to run the security script to secure your MySQL server. This is optional but highly recommended. Start it with: sudo mysql_secure_installation
The script will guide you interactively through the setup. First, you will be asked about password validation. We recommend choosing Y to allow only secure passwords in the future, then either MEDIUM with 1 or STRONG with 2.
Then you will be asked whether to remove the anonymous user and disable remote root login. For security reasons, confirm both with Y. This removes the test user and restricts root user access to local SSH only, minimizing risk.
Finally, you will be asked whether to remove the test database and reload privilege tables. We also recommend Y here, as the test database is not needed and privilege tables must be reloaded for changes.
Now check if the MySQL database is running by logging in with the following command: sudo mysql -u root. If successful, a welcome message appears. Use quit to exit the session.
Testing PHP
Finally, ensure PHP is working as expected. Create an info.php file in the Apache directory /var/www/html/ with the following content that runs the phpinfo() function.
Code
# Open nano editor for the new file
nano /var/www/html/info.php
# Insert the following content
<?php
phpinfo();
?>
Save the file with CTRL+X, then Y and Enter.
Now open the following URL in your browser, which should display a PHP info page if everything works:
Code
http://[your_ip_address]/info.php
Once the core components of the LAMP stack are tested and functional, you can start the actual WordPress installation.
Installation
The WordPress installation can be divided into three parts: first preparing the MySQL database, then installing WordPress, and finally configuring it via the WordPress setup wizard.
MySQL Database
To start, you need to create a new MySQL database. This is important because you will need this data later in the WordPress setup wizard. We recommend using our examples.
Simply copy the following commands to create the database, tables, and user.
Code
# Log into MySQL
sudo mysql -u root
# Create database
CREATE DATABASE wordpress;
# Create dedicated WordPress user
# Replace [your_password] with your own password
CREATE USER wordpress@localhost IDENTIFIED BY '[your_password]';
# Set permissions for the user (copy all as one command)
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
ON wordpress.*
TO wordpress@localhost;
# Reload privilege tables
FLUSH PRIVILEGES;
After setup, exit MySQL with quit. Now you are ready for the WordPress installation.
Installing WordPress
For the WordPress installation, we recommend using the official version from wordpress.org instead of the APT package. This is recommended by WordPress to avoid potential issues.
Download the latest version to the temporary directory with the following command:
Code
cd /tmp && wget https://wordpress.org/latest.tar.gz
Extract the archive, which creates a wordpress folder with all necessary files:
Code
tar -xvf latest.tar.gz
Copy the folder to your Apache directory /var/www/html/ so everything is accessible via the web. Run the following commands to copy the folder, create an uploads directory, and set permissions so the www-data group has access:
WordPress is now installed. Open the setup wizard at: http://[your_ip_address]/wordpress
Setup Wizard
In the setup wizard, you can now configure WordPress – the final step of the installation. First, you will be asked to select the language.
Then you must enter the database settings. You prepared these during the MySQL setup, so use the same credentials here. If you followed our examples, fill in the fields accordingly and replace [your_password] with your password.
After this step, you will be prompted to start the installation – this is the last part of the setup.
On the next page, enter various details including the site title, an email address, and a username and password for the WordPress root account you will use to log into the panel later. You can also set whether search engines are allowed to index your site.
Tip
Choose a strong password and save your login details so you don’t lose access to your WordPress panel!
When ready, click the Install WordPress button to complete the process.
You will be redirected to a success page that leads you to the Login. There, log in with your credentials for the first time to access the WordPress panel!
And you’re in – your WordPress panel with a complete installation.
Conclusion
Congratulations, you have successfully installed and configured WordPress! As a next step, we strongly recommend setting up a domain and an SSL certificate so your data is transmitted securely and access to the WordPress panel is easier. Check out our Certbot Guide focusing on the Apache plugin and follow the interactive setup to quickly and easily get a certificate for your desired domain.
For further information and setup tips, we recommend our WordPress Plugins and WordPress Elementor guides, which show you how to install plugins and use the popular, user-friendly page builder Elementor.
If you have questions or problems, our support team is available daily – don’t hesitate to contact us! 🙂
Server hosting from €2.49 / month, online instantly, DDoS protection included.