Deploy Wordpress
This guide shows you how to use Wordpress, a web content management system.
To run it, follow these steps:
-
Install the
kraft
CLI tool and a container runtime engine, e.g. Docker. -
Clone the
examples
repository andcd
into theexamples/wordpress-all-in-one/
directory:
git clone https://github.com/kraftcloud/examplescd examples/wordpress-all-in-one/
Make sure to log into Unikraft Cloud by setting your token and a metro close to you.
We use fra0
(Frankfurt, 🇩🇪) in this guide:
# Set Unikraft Cloud access tokenexport UKC_TOKEN=token# Set metro to Frankfurt, DEexport UKC_METRO=fra0
When done, invoke the following command to deploy this application on Unikraft Cloud:
kraft cloud deploy -p 443:3000 -M 3072 .
The output shows the instance URL and other details:
[●] Deployed successfully! │ ├────────── name: wordpress-fx5rb ├────────── uuid: bfb9d151-1604-452a-b2e0-f737486744df ├───────── state: starting ├──────── domain: https://cool-silence-h5c1es4z.fra0.kraft.host ├───────── image: wordpress@sha256:3e116e6c74dd04e19d4062a14f8173974ba625179ace3c10a2c96546638c4cd8 ├──────── memory: 3072 MiB ├─────── service: cool-silence-h5c1es4z ├── private fqdn: wordpress-fx5rb.internal ├──── private ip: 172.16.3.1 └────────── args: /usr/local/bin/wrapper.sh
In this case, the instance name is wordpress-fx5rb
.
They are different for each run.
Use a browser to access the install page of Wordpress. Fill out the form and complete the Wordpress install.
At any point in time, you can list information about the instance:
kraft cloud inst list
NAME FQDN STATE STATUS IMAGE MEMORY ARGS BOOT TIMEwordpress-fx5rb cool-silence-h5c1es4z.fra0.kraft.host running since 2mins wordpress@sha256:... 3.0 GiB /usr/local/bin/wrapper.sh 1708.17 ms
When done, you can remove the instance:
kraft cloud instance remove wordpress-fx5rb
Customize Your Deployment
The current deployment uses the current stable version of Wordpress (6.5.5).
It also uses hard-coded values for the database name, user name, passwords.
You can update the Dockerfile
with other names.
Or expand the configuration to feature non-hard-coded values.
Wordpress modules can be deployed in the Wordpress instance without affecting the Unikraft Cloud build.
Other features, such as placing the databases files in a separate volume, can be considered.
Learn More
Use the --help
option for detailed information on using Unikraft Cloud:
kraft cloud --help
Or visit the CLI Reference.