Skip to content
Script to generate a WordPress site in an LXD container.
Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
build.sh

README.md

lxd-wordpress

Bash script to generate an LXD WordPress site, configured with a Let's Encrypt certificate and an Exim installation for delivering WordPress notification emails.

Getting Started

You may want to first copy 'build.sh' to something like 'build-my-site.sh', since there are some environment variables at the top of the script that should be edited according to your installation. In particular, HOST and DB_PASS will need to be set to something specific to your installation.

Prerequisites

To run this script, you will need a working 'lxc' command on your host. See here for details on installing LXD.

I used snapd to install on Debian 9. Snap is simply a package manager by Canonical, and can be installed directly on Debian 9 onwards with 'sudo apt-get install snapd'.

Installing

With the script edited appropriately, it should be enough to just run ./build.sh (or whatever you copied it as before editing.

When the script has finished, if all went well, you can connect to the container with 'lxc exec wp-container bash'. This will put you in a root prompt inside the container.

From here, things should look like an ordinary VPS, with Apache and Exim running. You should be able to connect to your site and follow on with the standard WordPress configuration wizard.

There are a few notes here from when I originally moved to LXD for WordPress.

Contributing

This code is simply a generalised version of something I used for my own site. There's plenty of room for improvement, so pull-requests are welcome.

License

This project is licensed under the GNU GPLv2.

Acknowledgments

  • Thanks in particular to Neilpang for his awesome acme.sh script for generating Let's Encrypt certificates. Being dependent on nothing but bash helped significantly reduce the size of the container, which was one of my goals.
You can’t perform that action at this time.