Zudoku
Guides

Wordpress

This guide shows you how to use Wordpress, a web content management system.

To run it, follow these steps:

  1. Install the kraft CLI tool and a container runtime engine, e.g. Docker.

  2. Clone the examples repository and cd into the examples/wordpress-all-in-one/ directory:

TerminalCode
git clone https://github.com/kraftcloud/examples cd 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:

TerminalCode
# Set Unikraft Cloud access token export UKC_TOKEN=token # Set metro to Frankfurt, DE export UKC_METRO=fra0

A Wordpress instance on Unikraft Cloud requires 3GB to run. You may be required to request increasing the instance memory quota.

When done, invoke the following command to deploy this application on Unikraft Cloud:

TerminalCode
kraft cloud deploy -p 443:3000 -M 3072 .

The output shows the instance URL and other details:

TerminalCode
[โ—] 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:

TerminalCode
kraft cloud inst list
Code
NAME FQDN STATE STATUS IMAGE MEMORY ARGS BOOT TIME wordpress-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:

TerminalCode
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:

TerminalCode
kraft cloud --help

Or visit the CLI Reference.

Last modified on