How to Install WordPress with LAMP Stack on Debian 13
WordPress is one of the most popular website-building tools available out there. It is a simple way to get your online presence and perfect for those who do not know how to code and want a simple and effective way to share and build your story on the internet.
Prerequisites
-
Root access to your Debian 13 server.
- LAMP Stack installed and running. Learn how to setup LAMP Stack.
Create Database
Setup the database so the Wordpress can store in all the information. Log in to MariaDB as root user.
In this, we will create a Database, User and provide all kinds of privileges of managing the specific database to the user.
mysql -u root -p
Output:
root@server:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 31
Server version: 11.8.2-MariaDB-1 from Debian -- Please help get to 10k stars at https://github.com/MariaDB/Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
Now, create your WordPress database. We're creating it with wp_database as an example, but you can name it related to the website you're going to host.
CREATE DATABASE wp_database;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL ON `wp_database`.* TO `wpuser`@`localhost`;
FLUSH PRIVILEGES;
EXIT;
Download And Unzip WordPress
Visit the official Wordpress site to get to know the latest version available for download and also for more information on requirements of the server.
You can also use the below URL link to download the latest version at any given time.
cd /tmp
wget https://wordpress.org/latest.tar.gz
Unzip the downloaded WordPress file.
tar xpf latest.tar.gz
The resulting folder will be wordpress. It contains the entire WordPress install. How and where you copy it is entirely up to you and depends on your web server configuration
mkdir /var/www/wordpress
cp -R wordpress/* /var/www/wordpress/
Change the permissions and ownership to improve security and grant your webserver proper access.
chown -R www-data:www-data /var/www/wordpress
find /var/www/wordpress -type d -exec chmod 755 {} \;
find /var/www/wordpress -type f -exec chmod 644 {} \;
Create a Apache vHost
Using your favourite editor, we will create a config file in /etc/apache2/sites-available.
The config file can be the name of the website but it has to end with a .conf file extension.
We're using nano for adding the configuration :
nano /etc/apache2/sites-available/wordpress.conf
Add the following configuration in it:
<VirtualHost *:80>
ServerName dev.domainhere.info
ServerAdmin admin@test.com
DocumentRoot /var/www/wordpress
<Directory /var/www/wordpress>
Options -Indexes +FollowSymLinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/wordpress-error.log
CustomLog ${APACHE_LOG_DIR}/wordpress-access.log combined
</VirtualHost>
Note: Replace dev.domainhere.info with actual domain name
Next, we'll have to create a symbolic link, so the config file is available in sites-enabled as well.
ln -s /etc/apache2/sites-available/wordpress.conf /etc/apache2/sites-enabled/
Enable the new configuration,
a2ensite wordpress.conf
Test the configuration for any typos and syntax errors,
apachectl configtest
Once you get Syntax OK, restart apache web server for the changes to go live.
systemctl restart apache2
Access Wordpress
Open up a web browser and navigate to the domain name,
http://dev.domainhere.info
Note: Replace dev.domainhere.info with actual domain name
Follow the WordPress setup wizard to choose your site name, username, and password.





Conclusion
You now have WordPress running on a LAMP stack on Debian 13.
You can now:
- Install themes and plugins
- Write blog posts and pages
- Secure your site with HTTPS and backups
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS