This guide installs Drupal on a self-hosted Linux server using Composer.
| Component | Drupal 10 | Drupal 11 |
|---|---|---|
| PHP | 8.1+ | 8.3+ |
| MySQL | 8.0+ | 8.0+ |
| MariaDB | 10.6+ | 10.11+ |
| PostgreSQL | 14+ | 18+ |
| RAM | 512MB | 1GB+ |
| Disk | 2GB | 2GB+ |
| Composer | 2.1+ | 2.1+ |
mysqlipdo_mysqlxmlmbstringcurlzipintlgdsoap (optional)Install a LAMP (Linux, Apache, MySQL, PHP) or LEMP (Linux, Nginx, MySQL, PHP) stack:
Ubuntu/Debian (LAMP):
sudo apt update
sudo apt install apache2 mariadb-server php php-mysql php-xml php-mbstring php-curl php-zip php-intl php-gd composer unzip
RHEL/CentOS:
sudo dnf install httpd mariadb-server php php-mysqlnd php-xml php-mbstring php-curl php-zip php-intl php-gd composer unzip
Create a MySQL database and user for Drupal:
mysql -u root -p
CREATE DATABASE drupal DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'strong-password-here';
GRANT ALL PRIVILEGES ON drupal.* TO 'drupal'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Navigate to your web root and create a new Drupal project:
cd /var/www
composer create-project drupal/recommended-project drupal-site
cd drupal-site
Set correct ownership and permissions:
# Set ownership (adjust for your web server user)
sudo chown -R www-data:www-data /var/www/drupal-site
# Set directory permissions
find /var/www/drupal-site -type d -exec chmod 755 {} \;
# Set file permissions
find /var/www/drupal-site -type f -exec chmod 644 {} \;
Apache: Create a virtual host pointing to /var/www/drupal-site/web
Nginx: Configure server block with PHP-FPM, root pointing to /var/www/drupal-site/web
Open http://YOUR-SERVER/drupal-site in your browser.
The Drupal installer will guide you through:
See Drupal Configuration for configuration guidance.
See Drupal Security for hardening guidance.
Prefer automation? See these Ansible setup options:
Prefer containers? See Drupal Docker Setup.
Stuck on a step or need custom configuration? We provide paid consulting for Drupal deployments, from basic setups to enterprise configurations.