Operating System Debian

Install Nginx, WordPress and Let's Encrypt with EasyEngine 4 on Ubuntu 24.04

Install the Docker-based EasyEngine 4 on Ubuntu 24.04 or Debian 12 and create a WordPress site on Nginx with a Let's Encrypt certificate.

EasyEngine sets up a WordPress site behind Nginx with a Let's Encrypt certificate from a single command. This guide installs the current EasyEngine (version 4) on Ubuntu 24.04 LTS or Debian 12, creates a WordPress site with HTTPS, and covers the commands you need afterwards to inspect, change and update it. The same steps apply to Ubuntu 22.04 and Debian 13, which the EasyEngine installer is also tested on.

What changed since Debian 8 and Ubuntu 16.04

Older tutorials describe EasyEngine 3, a Python tool that installed Nginx, PHP and MySQL as system packages on Debian 8 or Ubuntu 16.04. Both of those releases are end-of-life, and the commands from that era, such as ee site create example.com --wp --letsencrypt, no longer apply.

EasyEngine 4 is a different design:

  • Every site runs in Docker containers. Nginx, PHP, the database and Redis are containers managed by EasyEngine, not packages on the host.
  • The ee command itself is a PHP program. The installer sets up Docker and a host PHP for it.
  • The site type and SSL are chosen with --type=wp and --ssl=le.
  • Each site can run its own PHP version, selected with --php.

Requirements

  • A fresh server running Ubuntu 24.04 LTS or Debian 12. Do not install Apache, Nginx or MySQL yourself first: EasyEngine's proxy container needs ports 80 and 443.
  • A user with sudo rights. The examples use deploy.
  • A domain name with an A record (and AAAA record if you use IPv6) pointing to the server. The examples use example.com. Let's Encrypt can only issue the certificate once the name resolves to this server.
  • Ports 80 and 443 open in any firewall in front of the server.

Install EasyEngine

Update the system, and install wget if the image does not include it:

sudo apt update
sudo apt upgrade -y
sudo apt install -y wget

Download and run the official installer:

wget -qO ee https://rt.cx/ee4 && sudo bash ee

According to the EasyEngine handbook, the installer sets up Docker and PHP for the command-line tool, downloads EasyEngine from the official builds repository and checks the download against its published SHA-512 checksum. If the download or the check fails, it stops without leaving a partial installation.

On a server that has just booted, automatic updates may still hold the package lock, which makes the installer fail. In that case tell it to wait for the lock:

wget -qO ee https://rt.cx/ee4 && sudo env EE_APT_LOCK_WAIT=1 bash ee

Confirm that the tool is installed:

sudo ee cli version

Set the Let's Encrypt contact email

EasyEngine issues and renews Let's Encrypt certificates only when a valid contact address is configured. Set it once, before you create the first site:

sudo ee config set le-mail admin@example.com

Check the stored value with:

sudo ee config get le-mail

Create a WordPress site with HTTPS

One command creates the containers, installs WordPress and requests the certificate:

sudo ee site create example.com --type=wp --ssl=le

The first site takes a few minutes because the container images have to be downloaded. When the command finishes it prints the site URL and the WordPress administrator login. You can set the administrator details yourself instead of accepting generated ones:

sudo ee site create example.com --type=wp --ssl=le --title="My Site" --admin-user=siteadmin --admin-email=admin@example.com

If you leave out --admin-pass, EasyEngine generates a random password and shows it in the site information. That keeps the password out of your shell history.

Useful variations of the create command:

OptionEffect
--cacheEnables Redis-based caching for the site
--php=8.3Runs the site on a specific PHP version instead of the default
--mu=subdir or --mu=subdomCreates a WordPress Multisite network (the subdomain type needs a wildcard certificate when SSL is on)
--ssl=selfUses a self-signed certificate, useful for a test site without public DNS
--type=php or --type=htmlCreates a plain PHP or static site instead of WordPress

For example, a cached WordPress site with HTTPS:

sudo ee site create example.com --type=wp --ssl=le --cache

The full option list is in the ee site create reference.

Verify the site

List the sites EasyEngine manages:

sudo ee site list

Show the details of one site, including its credentials and useful links:

sudo ee site info example.com

Then open https://example.com in a browser. You should see the default WordPress front page with a valid certificate, and https://example.com/wp-admin/ should accept the administrator login from the site information.

You can also check from the command line that the site answers over HTTPS:

curl -I https://example.com

Manage the site

Changes to an existing site go through ee site update. To add a Let's Encrypt certificate to a site that was created without one:

sudo ee site update example.com --ssl=le

To move a site to another PHP version:

sudo ee site update example.com --php=8.4

EasyEngine backs up the site's current PHP configuration before switching. If you are unsure whether your plugins and theme work on the new version, test on a copy first:

sudo ee site clone example.com staging.example.com
sudo ee site update staging.example.com --php=8.4

Delete the copy when you are done:

sudo ee site delete staging.example.com

Other commands you will use regularly:

  • sudo ee site restart example.com restarts the site's containers.
  • sudo ee site clean example.com clears the site's object and page caches.
  • sudo ee site disable example.com and sudo ee site enable example.com take a site offline and bring it back.
  • sudo ee site ssl-renew example.com renews the site's Let's Encrypt certificate by hand. Normally you do not need it: the Linux installer adds a daily root cron job that runs ee site ssl-renew --all, provided cron is installed. Check with sudo crontab -l.
  • sudo ee shell example.com opens a shell inside the site's PHP container, where you can work on the site's files.

Update EasyEngine

Update the tool and its containers with:

sudo ee cli update

An update can recreate site containers, which restarts the sites briefly, so run it at a quiet time. The host's own packages, including Docker, are still updated the usual way with sudo apt update && sudo apt upgrade.

Troubleshooting

  • The certificate is not issued. Check that the domain resolves to the server, that port 80 is reachable from the internet and that le-mail is set. Then retry with sudo ee site ssl-verify example.com.
  • The proxy container does not start. Another service is usually listening on port 80 or 443. Find it with sudo ss -tlnp, stop and remove it, then run the command again.
  • You need more detail about a failure. Add --debug to any ee command to see what it is doing. The EasyEngine handbook has a debugging page and a page about proxy container errors.

Frequently asked questions

Can I upgrade an EasyEngine 3 server in place?

Treat it as a migration, not an upgrade. EasyEngine 3 servers run on operating-system releases that are end-of-life, and version 4 stores sites in containers rather than in system packages. The safe route is a new server on a supported release, a fresh EasyEngine 4 install, and then moving each site's files and database across.

Do I need to know Docker to use EasyEngine 4?

Not for day-to-day work. The ee commands create, start and update the containers for you. Docker knowledge helps when something fails, because sudo docker ps and sudo docker logs show the state and output of the containers behind a site.

Can I host more than one site on the same server?

Yes. Run ee site create once per domain. A shared proxy container receives all traffic on ports 80 and 443 and routes each request to the right site, and each site can have its own PHP version and certificate.

How much memory does the server need?

Each site adds its own containers on top of the shared proxy and database services, so memory use grows with the number of sites. Watch actual usage with free -h and sudo docker stats after you add a site, and size the server from what you measure.

Share story:

Continue reading other guides on How VPS.