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, for example Docker.

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

Code(bash)
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. This guide uses fra (Frankfurt, ๐Ÿ‡ฉ๐Ÿ‡ช):

Code(bash)
# Set Unikraft Cloud access token export UKC_TOKEN=token # Set metro to Frankfurt, DE export UKC_METRO=fra

A Wordpress instance on Unikraft Cloud requires 3GB to run. Request an increase in the instance memory quota when you need more memory.

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

Code(bash)
kraft cloud deploy -p 443:3000 -M 3072 .

The output shows the instance address and other details:

Code(ansi)
[โ—] Deployed successfully! โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ name: wordpress-fx5rb โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ uuid: bfb9d151-1604-452a-b2e0-f737486744df โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ state: starting โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ domain: https://cool-silence-h5c1es4z.fra.unikraft.app โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ 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're different for each run.

Use a browser to access the install page of Wordpress. Fill out the form and complete the Wordpress install.

You can list information about the instance by running:

Code(bash)
kraft cloud inst list
Code(text)
NAME FQDN STATE STATUS IMAGE MEMORY ARGS BOOT TIME wordpress-fx5rb cool-silence-h5c1es4z.fra.unikraft.app running since 2mins wordpress@sha256:... 3.0 GiB /usr/local/bin/wrapper.sh 1708.17 ms

When done, you can remove the instance:

Code(bash)
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.

You can deploy WordPress modules in the WordPress instance without affecting the build.

Learn more

Use the --help option for detailed information on using Unikraft Cloud:

Code(bash)
kraft cloud --help

Or visit the CLI Reference.

Last modified on