WordPress Installation with Caddy: Automatic SSL Installation on CentOS 7
What will you learn in this guide?
In this guide, you will install WordPress on CentOS 7 with Caddy web server.
Installation is accelerated because Caddy receives automatic SSL with Let's Encrypt.
🧠 Technical summary
Main topic: WordPress deployment with CentOS 7 + Caddy + PHP-FPM + MySQL.
Problem solved: Easier TLS and simple config instead of Apache/Nginx.
Steps: Install PHP, run PHP-FPM with Caddy, open MySQL DB, download WP, write Caddyfile, finish the web installation.
✅ Prerequisites
- 1 CentOS 7 Cloud Server
- non-root user with sudo authority
- MySQL installed and root password ready
- Caddy installed
- Domain DNS looks at server IP (example:
wp.ornek.com) - Ports 80 and 443 are open
1️⃣ Install PHP and WordPress extensions
- Update the system packages first.
sudo yum update -y
- This command updates packages.
- Install the PHP and plugins needed by WordPress.
sudo yum install -y php php-fpm php-mysql php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc
- This command installs PHP, PHP-FPM and necessary modules.
- Check the installation.
php -v
- This command verifies the PHP version.
2️⃣ Run PHP-FPM with user Caddy
CentOS default comes with Apache focus. That's why we change the PHP-FPM user and group.
- Open the file.
sudo vi /etc/php-fpm.d/www.conf
- This file contains PHP-FPM pool settings.
- Find and replace the following lines.
user = caddy
group = caddy
- This setting runs PHP-FPM processes via caddy.
- Start PHP-FPM.
sudo systemctl start php-fpm
- This command enables the PHP-FPM service to run.
- If you want, also turn on autostart.
sudo systemctl enable php-fpm
- This command starts PHP-FPM at server startup.
3️⃣ Create MySQL database and user for WordPress
- Log in to MySQL with root.
mysql -u root -p
- This command opens the MySQL administrator session.
- Create the database.
CREATE DATABASE genixnode_wp DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
- This database is for WordPress.
- Create user and grant authorization.
GRANT ALL ON genixnode_wp.* TO 'genixnode_wpuser'@'localhost' IDENTIFIED BY 'GucluSifre_123!';
- This user only manages this database.
- Renew authorizations and exit.
FLUSH PRIVILEGES;
EXIT;
- This action activates the changes.
4️⃣ Download WordPress and set file permissions
- Change to the web root directory.
cd /var/www
- This folder is used for site files.
- Download WordPress.
sudo curl -O https://wordpress.org/latest.tar.gz
- This command downloads the current version of WordPress.
- Extract the archive.
sudo tar zxf latest.tar.gz
- This command creates the wordpress folder.
- Delete the archive.
sudo rm -f latest.tar.gz
- This command removes unnecessary file.
- Let Caddy own the files.
sudo chown -R caddy:caddy /var/www/wordpress
- This setting makes it easier to update WordPress from the web panel.
Note: Write permission is controversial in security.
- If you want, only wp-content can be made writable.
5️⃣ Configure Caddy to serve WordPress
- Open Caddyfile.
sudo vi /etc/caddy/Caddyfile
- This file holds Caddy's site settings.
- Add an example structure.
wp.ornek.com {
tls admin@ornek.com
root /var/www/wordpress
gzip
fastcgi / 127.0.0.1:9000 php
rewrite {
if {path} not_match ^\/wp-admin
to {path} {path}/ /index.php?_url={uri}
}
}
- This structure sets up WordPress permalink and PHP processing.
- Restart the Caddy.
sudo systemctl restart caddy
- This command applies Caddyfile changes.
- Caddy receives SSL from Let's Encrypt when opening.
- It is normal to see a lock sign on the browser.
6️⃣ Complete the WordPress installation wizard
- Navigate to your domain in the browser.
https://wp.ornek.com
1. Select language and enter database information.
2. Database name: genixnode_wp
3. User: genixnode_wpuser
4. Password: the password you created
5. Host: localhost
Finish the installation and create an administrator account. Do not use admin in the username.
❓ Frequently Asked Questions (FAQ)
1. Why is Caddy preferred? It receives automatic SSL and its configuration is simpler.
2. Why can some plugins cause problems? Some plugins expect .htaccess. Caddy doesn't use this.
3. Is it safe to write to WordPress files? Updating becomes easier, but the risk increases. Only wp-content can be made writable.
4. What do HTTP/2 and gzip provide? Provides faster page loading and less bandwidth usage.
5. If I don't receive an SSL certificate, what should I check first? Check DNS records and 80/443 port access.
🎯 Result
You have published WordPress on CentOS 7 with Caddy. You've built a fast foundation with automatic TLS, HTTP/2, and gzip.
👉 You can create a Cloud Server on the GenixNode platform and try this setup in minutes.

