October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Install WordPress with LAMP on Debian

A command-by-command guide to installing WordPress on Debian with Apache, MariaDB and PHP, using Debian’s package paths, hostname-based configuration and maintenance workflow.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The most maintainable Debian installation uses the distribution’s WordPress package with Apache, MariaDB and PHP. Install the packages with apt, harden MariaDB, create a separate WordPress database account, configure an Apache virtual host for /usr/share/wordpress, add Debian’s hostname-specific configuration file, and finish at /wp in a browser. The procedure below also explains the version checks, security decisions, updates and common failures that matter when moving from a private test machine to a public site.

What you need before installing

Use a supported Debian release and an account with sudo or root access. You need a resolvable hostname or domain for the site, shell access to the server, a text editor, and a browser on a machine that can reach the server. A local hostname can work for a private installation; a public site needs DNS pointed at the server before the browser setup is useful.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WordPress’s current production guidance calls for PHP 8.3 or newer, MariaDB 10.11 or newer or MySQL 8.0 or newer, HTTPS, and Apache or Nginx. Debian’s packaged versions vary by release, so check what your release supplies before committing to a production deployment.

Debian release WordPress package version listed by Debian
Debian 11 (Bullseye) 5.7.14
Debian 12 (Bookworm) 6.1.9
Debian 13 (Trixie) 6.8.3

Those package versions are the versions listed on Debian’s WordPress page in January 2026; they are not a promise that every mirror will remain unchanged. For a public site, compare the PHP and database versions installed by your Debian release with the current WordPress requirements, and plan upgrades rather than assuming an old stable release will satisfy new WordPress versions indefinitely.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Choose the installation model

This guide uses Debian’s package layout, not the layout from a manually downloaded upstream archive. The package integrates with Debian’s filesystem conventions and update path. That means the application files live under /usr/share/wordpress, while content is stored under /var/lib/wordpress/wp-content. Do not copy generic instructions that expect a complete WordPress tree in /var/www/html without adapting every path.

A single-site virtual host is the clearest starting point. Debian also documents helper-script and multisite arrangements; read /usr/share/doc/wordpress/README.Debian before choosing one, because its aliases, configuration-file lookup and upgrade behavior differ from a conventional upstream-tarball installation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install Apache, MariaDB, PHP and Debian WordPress

Refresh package metadata and install the stack:

sudo apt update
sudo apt install wordpress curl apache2 mariadb-server

The Debian package pulls in the PHP pieces it declares as dependencies. Debian’s LAMP guidance identifies the MariaDB server and client and PHP’s MySQL connector as the required database components. If the connector was not installed by dependency resolution on your release, install the corresponding Debian PHP package that provides php-mysql, then verify that Apache’s PHP integration is enabled before opening the site.

Check that the services are present before continuing. A package installation can complete while a service is stopped because of a local policy or a configuration error. Use your normal Debian service-management commands to confirm Apache and MariaDB are running, and read their logs immediately if either fails to start.

Harden MariaDB and create a WordPress database

Run the hardening utility

Start with Debian’s interactive hardening tool:

sudo mysql_secure_installation

Follow its prompts to remove unsafe defaults and restrict administrative access. The exact questions vary with the MariaDB version and how the server was initially configured, so read each prompt instead of blindly accepting a transcript copied from another release.

Use a dedicated database and account

WordPress should never use the MariaDB administrator account. Create one database and one application user, and grant that user privileges on that database only. Replace the example password with a long, unique secret; do not publish it or leave it in shell history.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
CREATE DATABASE wordpress;
CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'replace-with-a-strong-secret';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';
FLUSH PRIVILEGES;

Save the SQL in a root-readable temporary file rather than placing the password directly in a command that will be recorded by a shell. Execute it with Debian’s local administrative MariaDB client, then remove the file as soon as the account has been created:

sudo mariadb < /root/wp-db.sql
sudo rm /root/wp-db.sql

The database name, user name, host and password in this SQL must match the values you will put in Debian’s WordPress configuration file. A mismatch produces a database-connection error later, even when MariaDB itself is healthy.

Configure an Apache virtual host

Create the site definition

Create /etc/apache2/sites-available/wp.conf and replace myblog.example.com and the administrator address with your own values:

<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>

The two directory blocks are important. The document root exposes Debian’s packaged PHP application, while the alias exposes the writable content location where uploads, themes and plugins belong. DirectoryIndex index.php makes Apache hand the front page to PHP instead of showing a directory listing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Disable the default site and enable WordPress

sudo a2dissite 000-default
sudo a2ensite wp
sudo service apache2 reload

Reloading applies the virtual-host change without needlessly stopping the web server. If Apache reports a syntax error, correct that error before attempting another reload; the previous working configuration remains in effect until a valid reload succeeds.

This configuration is intentionally HTTP-only so the package layout can be verified first. Before exposing an administrator login publicly, put the site behind HTTPS and ensure the hostname resolves to the intended machine. WordPress lists HTTPS as part of its current production guidance.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Add Debian’s hostname-specific WordPress configuration

Create the file Apache will select

For the virtual host myblog.example.com, create:

/etc/wordpress/config-myblog.example.com.php

Put the database settings and Debian content path in that file:

<?php
 define('DB_NAME', 'wordpress');
 define('DB_USER', 'wordpress');
 define('DB_PASSWORD', 'replace-with-a-strong-secret');
 define('DB_HOST', 'localhost');
 define('WP_CONTENT_DIR', '/var/lib/wordpress/wp-content');
?>

Replace the password with the same secret used when creating the MariaDB user. Keep the file readable by the web process but protected from unrelated users; use the ownership and mode recommended in /usr/share/doc/wordpress/README.Debian for your Debian release.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand the filename lookup

Debian’s package chooses configuration files according to the HTTP hostname. The hostname-specific form above is the safest choice for a named virtual host. Debian also documents config-example.com.php and config-default.php fallback choices. A request that arrives with a different host header can therefore select a different file or fail to find the values you expected. Make the Apache ServerName, DNS name and configuration filename agree.

Complete the installation in a browser

Open the site at:

http://myblog.example.com/wp

Debian documents this path redirecting to /wp/wp-admin/install.php. The normal WordPress screen asks for the site title, administrator account, administrator password and email address. Choose a unique administrator name and a password that is not reused elsewhere. If the site is public, complete the HTTPS setup before entering credentials over the network.

If the browser cannot resolve the domain yet, use the server’s local hostname for a private test or correct DNS first. Do not treat a successful page load from one machine as proof that the public DNS, firewall and virtual host are correct; those are separate network paths.

Verify the stack before adding content

Confirm the request reaches the intended virtual host

The page should be generated by WordPress, not an Apache directory index or the default Debian landing page. The URL should retain the /wp path during the documented redirect. If another site appears, check the browser’s hostname, DNS records, the ServerName value and which sites are enabled.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Confirm PHP is being executed

A PHP download prompt or source code displayed in the browser means Apache is serving the file as static text. Check that the PHP Apache integration and the MySQL connector are installed for your Debian release, that DirectoryIndex index.php is present, and that the WordPress virtual host is the enabled one. Inspect Apache’s error log after each configuration change.

Confirm the content alias

Uploads and installed extensions use /var/lib/wordpress/wp-content. If the administration screen reports that it cannot write uploads, verify the alias and the directory block in wp.conf, then check the directory ownership and permissions recommended by Debian. Do not move the content directory to an upstream-tarball path without also changing the Debian configuration.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Maintenance after the first login

Apply Debian security updates

Debian specifically directs administrators to update the WordPress package and its dependencies through APT:

sudo apt update
sudo apt upgrade

Review the proposed package changes, especially on a production site, and keep a current backup before a substantial upgrade. Debian’s package update path is one of the main reasons to stay with the distribution layout instead of mixing files from an upstream archive.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read the Debian maintenance notes

Before changing themes, plugins, content paths, multisite behavior or upgrade mechanics, read /usr/share/doc/wordpress/README.Debian. It records Debian-specific helper scripts and filesystem assumptions that generic WordPress tutorials do not cover.

Plan capacity realistically

The WordPress Hosting Handbook lists 128 MB as sufficient for a vanilla installation. That is a baseline, not a capacity plan: heavy plugins, complex themes, image processing, cron activity and traffic can require substantially more memory and CPU. Monitor the server after enabling real workloads and size PHP, MariaDB and storage accordingly.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Troubleshoot the failures that occur most often

Database connection error

  • Compare DB_NAME, DB_USER, DB_PASSWORD and DB_HOST in the hostname-specific PHP file with the database and account you created.
  • Check that the MariaDB service is running and accepting local connections.
  • Verify that the WordPress account is granted privileges on wordpress.* and that the account host is localhost when the configuration uses DB_HOST set to localhost.
  • Look at the MariaDB and Apache logs for authentication or connection errors instead of repeatedly changing the password.

Apache shows a directory listing or downloads PHP

  • Confirm DocumentRoot /usr/share/wordpress and DirectoryIndex index.php are in the enabled virtual host.
  • Verify that PHP and the Debian MySQL connector are installed and that Apache’s PHP integration is active.
  • Run an Apache configuration check, correct syntax errors, reload, and test again.

Permalinks return 404

Review Apache rewrite and module settings and then read the Debian README before adding rules copied from an unrelated installation method. Pretty-permalink instructions for an upstream archive may assume a different document root or override policy than this package configuration.

The wrong configuration file is loaded

Check the hostname in the browser request, Apache’s ServerName, and the spelling of config-myblog.example.com.php. Debian selects the first matching configuration based on the HTTP hostname, so a request sent to an IP address or an alternate alias can bypass the file you edited.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Debian package versus an upstream archive

Decision Debian package approach Upstream archive approach
Filesystem layout /usr/share/wordpress for application files and /var/lib/wordpress/wp-content for content Uses the archive’s chosen web-root layout
Configuration Hostname-based files under /etc/wordpress Normally follows the archive’s own configuration placement
Updates Managed with Debian’s package tools Managed separately from Debian’s package database
Best fit Administrators who want Debian integration and a consistent update path Administrators who deliberately need the upstream release workflow and can maintain its layout

Neither choice is automatically safer. The operational risk comes from mixing them: an Apache alias from one method, a configuration file from another and application files from a third can produce missing uploads, failed upgrades or an unexpected database connection.

Single-site, private and public deployments

Single-site virtual host

The virtual host in this guide is appropriate when one hostname serves one WordPress site. It makes the document root, content alias and configuration filename easy to audit. Add additional sites as separate virtual hosts with their own hostnames and database accounts rather than reusing the first site’s credentials.

Private or local installation

A local hostname and HTTP can be acceptable while learning or testing on a network that is not exposed to untrusted users. Even in that setting, use a dedicated database account and keep the configuration file protected. Treat a private test as disposable only after you have verified that you can restore its database and content.

Public production site

A public deployment needs resolvable DNS, HTTPS, regular Debian updates, backups of both the database and wp-content, and a review of firewall and administrative access. The current WordPress requirements also call for PHP 8.3 or newer and MariaDB 10.11 or newer or MySQL 8.0 or newer. If the Debian release supplies older versions, choose a supported upgrade path before opening the site to the internet.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Operational checklist

  • Supported Debian release with shell and root or sudo access
  • Resolvable hostname and a browser that can reach the server
  • Apache, MariaDB, PHP and the Debian WordPress package installed through APT
  • MariaDB hardened with mysql_secure_installation
  • Separate WordPress database and least-scope application account
  • Apache virtual host using /usr/share/wordpress and the /wp-content alias
  • Matching /etc/wordpress/config-hostname.php values
  • Browser setup completed at /wp
  • HTTPS, backups and an update schedule before public launch

Once these checks pass, Debian’s package layout gives you a predictable WordPress installation: Apache serves the packaged application, MariaDB stores site data through a dedicated account, and content remains in Debian’s designated writable directory. Keep that separation intact as you add themes, plugins and additional sites.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.