Recommended Free Tools
On Debian, the most maintainable way to deploy WordPress with a LAMP stack is to install Debian’s wordpress package alongside Apache, MariaDB, and PHP, then connect it to a dedicated database and Apache virtual host. The package places core files in /usr/share/wordpress, stores writable content in /var/lib/wordpress/wp-content, and finishes through a browser at /wp.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
The commands below cover a single-site installation. They assume a supported Debian release, a resolvable hostname, shell access with root or sudo privileges, and a browser. For a public site, use HTTPS and verify that your Debian release provides versions compatible with WordPress’s current production guidance before you begin.
As an Amazon Associate I earn from qualifying purchases.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Check compatibility before installing
WordPress’s current production guidance recommends PHP 8.3 or newer, MariaDB 10.11 or newer or MySQL 8.0 or newer, HTTPS, and Apache or Nginx. Debian’s packaged WordPress version depends on the Debian release, so check the versions available on the server instead of assuming that every release meets those upstream recommendations.
| Debian release | WordPress version listed by Debian | What to verify |
|---|---|---|
| Debian 11 (Bullseye) | 5.7.14 | PHP and database versions supplied by the release may be below current upstream production guidance. |
| Debian 12 (Bookworm) | 6.1.9 | Check the installed PHP and MariaDB versions before exposing the site publicly. |
| Debian 13 (Trixie) | 6.8.3 | Confirm the exact versions offered by your enabled repositories and security updates. |
These package versions are the versions listed on Debian’s WordPress page in January 2026; they can change as Debian updates its repositories. Check your system with:
#1 Best Overall
cat /etc/debian_version
apt policy wordpress php mariadb-server
You also need a hostname that resolves to the server. For a private test, you can map a name to the machine’s address in the client’s /etc/hosts; for an Internet-facing site, create the appropriate DNS record. Keep the name you choose consistent in Apache and in Debian’s WordPress configuration filename.
Pre-installation checklist
- Use a supported Debian release with package repositories and security updates enabled.
- Confirm root or
sudoaccess and have a text editor available for Apache and PHP configuration files. - Decide whether this is a private test site or a public production site. Public deployments need DNS, HTTPS, backups, and additional hardening.
- Record the exact hostname, because Debian uses the HTTP hostname to select a WordPress configuration file.
- Have a browser available on a machine that can resolve and reach the hostname.
WordPress can run on many PHP-capable servers, but Apache or Nginx is the recommended robust and featureful choice. This guide uses Apache because it matches Debian’s documented package layout.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Install Apache, MariaDB, PHP support, and WordPress
Refresh package metadata and install Debian’s integrated WordPress package:
apt update
apt install wordpress curl apache2 mariadb-server
The wordpress package pulls in the PHP components it declares as dependencies. Debian’s LAMP guidance identifies the PHP MySQL connector as a required part of the stack. If the resolver did not install it for your release, add the release’s package explicitly:
apt install php-mysql
Confirm that the services are running and that PHP is available to Apache:
systemctl enable --now apache2 mariadb
php -v
apachectl -M | grep -E 'php|mpm'
The exact PHP Apache module name varies by Debian release. If no PHP integration appears, inspect the installed PHP packages and Apache modules before continuing; otherwise Apache may display PHP source code or offer .php files for download.
The package route is deliberately different from downloading a WordPress archive. Debian owns the core files, configuration conventions, and update path, while writable site data is separated into /var/lib/wordpress/wp-content. Do not unpack a second copy into the Apache document root after completing these commands: doing so makes it unclear which copy receives security updates and which configuration Apache is serving.
Harden MariaDB and create a WordPress database
Run the MariaDB hardening tool
Start the interactive hardening process:
mysql_secure_installation
Answer its prompts deliberately. Remove anonymous accounts, prevent remote administrative login where appropriate, remove the test database, and reload privilege tables. The wording differs slightly between MariaDB releases, so read each prompt rather than applying a copied answer sequence blindly.
Create a separate database and application user
WordPress should never connect as the MariaDB administrator. Create one database and one user for this site, granting privileges only on that database. The following example uses the names wordpress and wordpress; choose a strong, unique password and substitute it for the example value.
To keep the password out of normal shell history, write the SQL to a temporary file readable only by root:
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteRank #2
umask 077
cat > /root/wordpress-db.sql <<'SQL'
CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'replace-with-a-long-random-secret';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';
FLUSH PRIVILEGES;
SQL
mysql < /root/wordpress-db.sql
rm -f /root/wordpress-db.sql
Use a password manager or another protected method to retain the secret for the configuration step. Do not publish it in documentation, paste it into a public issue, or leave the SQL file on the server.
Check that MariaDB recognizes the account and database:
mysql -e "SHOW DATABASES;"
mysql -e "SHOW GRANTS FOR 'wordpress'@'localhost';"
The grant should be scoped to wordpress.*, not to every database on the server. The host portion of the account matters: an account created for localhost is not automatically the same account as one created for 127.0.0.1. Keep DB_HOST consistent with the account you create.
Configure Apache with a dedicated virtual host
Debian’s package layout expects WordPress core at /usr/share/wordpress and writable content at /var/lib/wordpress/wp-content. Create a site definition at /etc/apache2/sites-available/wp.conf:
<VirtualHost *:80>
ServerName myblog.example.com
ServerAdmin [email protected]
DocumentRoot /usr/share/wordpress
Alias /wp-content /var/lib/wordpress/wp-content
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
<Directory /var/lib/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Replace myblog.example.com with the hostname users will request. The ServerName, DNS record (or local hosts entry), and Debian configuration filename must agree.
Disable Debian’s default site, enable the new virtual host, validate the syntax, and reload Apache:
a2dissite 000-default
a2ensite wp
apachectl configtest
service apache2 reload
apachectl configtest should report Syntax OK. If it reports an error, correct the configuration before reloading. Check the active site list with:
apache2ctl -S
The configuration above intentionally follows Debian’s package conventions. Pretty permalinks, multisite, and alternate helper-script layouts have additional requirements. Read /usr/share/doc/wordpress/README.Debian before adding rewrite rules or changing the document and content paths; do not combine instructions for an upstream tarball with this package layout.
Single site or multisite?
This virtual host is for one ordinary WordPress site. A multisite installation or Debian’s alternate helper-script arrangement can use different aliases, rewrite behavior, and setup steps. Decide before creating the site rather than converting paths casually afterward. Debian documents those alternatives in README.Debian; follow one complete layout and do not mix helper-script instructions with a manually assembled upstream layout.
Create Debian’s hostname-specific WordPress configuration
Debian’s package selects configuration files according to the HTTP hostname. For myblog.example.com, create:
Rank #3
/etc/wordpress/config-myblog.example.com.php
Put the database values and content path in that file:
<?php
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpress');
define('DB_PASSWORD', 'replace-with-a-long-random-secret');
define('DB_HOST', 'localhost');
define('WP_CONTENT_DIR', '/var/lib/wordpress/wp-content');
?>
Replace the password with the exact secret used when creating the MariaDB account. Keep the file readable by the web process but protected from unrelated users:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
chown root:www-data /etc/wordpress/config-myblog.example.com.php
chmod 640 /etc/wordpress/config-myblog.example.com.php
Debian also documents fallback names such as config-example.com.php and config-default.php. A hostname-specific file is safer for a server hosting more than one site because each virtual host can select its own database settings. Ensure that the browser’s Host header matches the name in the filename; otherwise WordPress may use a different configuration or fail to find one.
Keep this file outside the document root. It contains the database password and should not be copied into a public backup, pasted into a support ticket, or made world-readable. If you change the database password later, update both MariaDB and this file together, then retest the site.
Finish the installation in your browser
- Open
http://myblog.example.com/wp, replacing the hostname with yours. Debian documents this path as redirecting to/wp/wp-admin/install.php. - Enter a site title, an administrator username, a strong administrator password, and an email address.
- Complete the installer and sign in at the administrator URL it provides.
- For a public server, configure HTTPS before using the administrator login over the Internet. WordPress’s current requirements list HTTPS for production deployments.
If the page does not load, verify DNS or the local hosts entry, confirm that Apache is listening on port 80, and inspect the virtual-host and error logs. A successful browser redirect confirms that Apache is serving the Debian package and that the hostname-specific configuration was found.
For a private installation, the local hostname can be sufficient. For a public installation, complete DNS and HTTPS work before inviting users or entering production data. The browser installer creates the site-level administrator account; it does not replace operating-system, database, or web-server hardening.
Verify the completed LAMP stack
Run these checks after the browser installer finishes:
- Apache:
systemctl status apache2should show an active service, andapache2ctl -Sshould show the WordPress virtual host. - MariaDB:
systemctl status mariadbshould show an active service. The WordPress user should have grants only on its own database. - PHP: Confirm the installed version with
php -vand ensure Apache has PHP integration enabled. - Files: Core files should remain under
/usr/share/wordpress; uploads, themes, and plugins belong under/var/lib/wordpress/wp-contentwith permissions that allow the web process to write where needed. - Hostname: Request the site using the same hostname used in
ServerNameand the configuration filename.
Check both an ordinary front-end page and /wp/wp-admin. Confirm that a test upload is stored in the content location and that the administrator can sign out and sign back in over the intended protocol. These simple checks catch mismatched aliases, permissions, and hostnames before the site receives visitors.
Keep Debian WordPress updated
Use Debian’s package manager for WordPress, Apache, PHP, and MariaDB security updates:
apt update
apt upgrade
Review the proposed changes before confirming them, especially on a production site. Debian’s package integration is the reason paths and update procedures differ from an installation made by unpacking an upstream archive.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #4
Before changing themes, plugins, content locations, multisite behavior, or upgrade mechanics, read:
/usr/share/doc/wordpress/README.Debian
Keep independent backups of the database and /var/lib/wordpress/wp-content. A backup is only useful if you can restore it, so periodically test restoration on a separate system or maintenance instance. Apply updates during a planned window when plugin or theme compatibility matters.
Package updates can change the WordPress version supplied by a Debian release, but they do not remove the need to review plugin and theme compatibility. Keep a record of the installed Debian release, PHP version, database version, and enabled extensions so a future upgrade can be evaluated against WordPress’s PHP 8.3+, MariaDB 10.11+/MySQL 8.0+, and HTTPS production guidance.
Troubleshoot common installation failures
Apache shows a directory listing or downloads PHP
Check that the WordPress virtual host is enabled, DirectoryIndex index.php is present, and Apache’s PHP integration and MySQL PHP connector are installed. Confirm the request is reaching the intended virtual host with apache2ctl -S, then inspect /var/log/apache2/error.log.
Free tools Windows power users keep installed
One-click scans. No signup required.
“Error establishing a database connection”
Compare every value in /etc/wordpress/config-myblog.example.com.php with the database you created: DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST. Check MariaDB’s service state and verify the account’s grants. A password typo, a user created for a different host (for example, 127.0.0.1 instead of localhost), or a missing database is more common than a WordPress defect.
Permalinks return 404 errors
Review Apache rewrite and module settings and follow the Debian instructions in /usr/share/doc/wordpress/README.Debian. Rules copied from an unrelated upstream-tarball installation may reference the wrong document root or permissions.
The installer uses the wrong site configuration
Check the hostname in the browser address bar, Apache’s ServerName, and the filename under /etc/wordpress. Debian chooses the first matching configuration based on the HTTP hostname, so a mismatch can select a fallback file.
The site works locally but not from the Internet
Confirm that public DNS points to the server, the firewall permits the web service, and Apache is bound to the expected address. Add HTTPS before exposing the login page publicly, and avoid testing with a hostname that resolves to a different machine.
Updates appear to change the wrong copy
Look at the active virtual host and document root with apache2ctl -S, then confirm that /usr/share/wordpress is the directory being served. If an archive was previously unpacked elsewhere, remove the ambiguity before updating; otherwise Debian may update one installation while Apache serves another.
Package installation versus an upstream archive
| Decision point | Debian package | Upstream archive |
|---|---|---|
| File layout | Uses /usr/share/wordpress and /var/lib/wordpress/wp-content. |
Uses the directory layout you choose when unpacking the archive. |
| Configuration | Hostname-aware files under /etc/wordpress. |
Usually configured inside the application directory according to upstream instructions. |
| Updates | Managed with Debian’s package and security-update process. | Requires the archive’s own upgrade procedure. |
| Best fit | Administrators who want Debian integration and predictable system paths. | Administrators who specifically need a release or layout not supplied by their Debian repositories. |
Choose one method for a site. Mixing package paths, permissions, and upgrade instructions can leave Apache serving one copy while updates modify another. The package route is generally the simpler choice when the Debian-supplied WordPress version and PHP/database versions satisfy your requirements; an archive is a deliberate alternative, not an extra step in this procedure.
Best Value
Private test site versus public production site
A local or private installation mainly needs a reachable hostname, working services, and a browser. A public site adds operational requirements: DNS must resolve to the server, HTTPS must protect administrator credentials, backups must cover both the database and writable content, and MariaDB and Apache should be hardened rather than left at default settings.
Before switching from testing to production, verify the exact PHP and database versions against WordPress’s current requirements, confirm that the virtual host is the only intended site answering for the hostname, and test a restore of the database and wp-content. Capacity also matters: the hosting handbook lists 128 MB as sufficient for a vanilla installation, but plugins, themes, image processing, administrator concurrency, and traffic can require substantially more.
Resource expectations
WordPress’s hosting handbook lists 128 MB as sufficient for a vanilla installation. That is a baseline, not a capacity guarantee: media processing, large themes, demanding plugins, concurrent administrators, and traffic can require substantially more memory, CPU, storage, and database capacity. Measure the workload and plan capacity before adding resource-intensive features.
Frequently Asked Questions
Which Debian package command installs the complete WordPress LAMP stack?
Run apt update, then apt install wordpress curl apache2 mariadb-server. If your release did not install the PHP MySQL connector as a dependency, add apt install php-mysql.
Why should WordPress have its own MariaDB user?
A dedicated account limits WordPress to its own database instead of granting the application administrator-level access to every database. Create a separate user, grant it privileges on wordpress.*, and use a strong unique password.
Where does Debian’s WordPress package store files?
Core files are under /usr/share/wordpress. Writable uploads, themes, and plugins are exposed from /var/lib/wordpress/wp-content. Hostname-specific database settings belong under /etc/wordpress.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →What URL opens the Debian WordPress installer?
Open the configured hostname followed by /wp, such as http://myblog.example.com/wp. Debian documents a redirect to /wp/wp-admin/install.php.
What should I do if WordPress reports a database connection error?
Compare DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST with the MariaDB database and account. Check systemctl status mariadb and the grants, paying attention to the difference between localhost and 127.0.0.1.
Should I use Debian’s package or an upstream WordPress archive?
Use the Debian package when you want Debian’s filesystem layout, hostname-aware configuration, and package-managed updates. Use an archive only when you deliberately need a release or layout not supplied by your repositories, and never mix the two layouts.
Is 128 MB enough memory for WordPress?
The WordPress Hosting Handbook lists 128 MB as sufficient for a vanilla installation. Media processing, heavy plugins, large themes, concurrent users, and traffic can require more memory and other resources.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →What must be checked before making the site public?
Confirm that DNS reaches the server, the Debian-provided PHP and database versions meet current WordPress guidance, MariaDB has been hardened, HTTPS protects the login, and tested backups cover the database and /var/lib/wordpress/wp-content.
The Bottom Line
Install Debian’s wordpress package with Apache and MariaDB, create a least-privilege database account, map a dedicated virtual host to Debian’s WordPress paths, add the hostname-specific configuration file, and complete setup at /wp. Keep the stack maintained with Debian updates and follow README.Debian whenever you change the package’s layout or behavior.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




