Zudoku
Guides

SolidJS

This guide shows how to deploy a Solid Start app. To do so, 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/node21-solid-start/ directory:

Code(bash)
git clone https://github.com/kraftcloud/examples cd examples/node21-solid-start/

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

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

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

The output shows the instance address and other details:

Code(ansi)
[โ—] Deployed successfully! โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ name: node21-solid-start-lvoa2 โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ uuid: 4e6ccb1f-0533-4dc1-be67-eca8dfc1f8c6 โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ state: running โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ url: https://long-star-1tms9h1z.fra.unikraft.app โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ image: node21-solid-start@sha256:eb2e79b2fc5c28bb43923a1fc4931db94ebc3f939a6fbe00d06189c0ae2e02fd โ”œโ”€โ”€โ”€โ”€โ”€ boot time: 67.65 ms โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ memory: 256 MiB โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€ service: long-star-1tms9h1z โ”œโ”€โ”€ private fqdn: node21-solid-start-lvoa2.internal โ”œโ”€โ”€โ”€โ”€ private ip: 172.16.6.8 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ args: /usr/bin/node /usr/src/server/index.mjs

In this case, the instance name is node21-solid-start-lvoa2 and the address is https://long-star-1tms9h1z.fra.unikraft.app. They're different for each run. You can now point your browser at the address to see your deployed instance.

You can list information about the instance by running:

Code(bash)
kraft cloud instance list
Code(text)
NAME FQDN STATE CREATED AT IMAGE MEMORY ARGS BOOT TIME node21-solid-start-lvoa2 long-star-1tms9h1z.fra.unikraft.app running 1 minutes ago node21-sol... 256 MiB /usr/bin/node /usr/src/server... 67.65 ms

When done, you can remove the instance:

Code(bash)
kraft cloud instance remove node21-solid-start-lvoa2

Customize your app

To customize the app, update the files in the repository, listed below:

  • Kraftfile: the Unikraft Cloud specification
  • Dockerfile: the Docker-specified app filesystem
  • src/: server source files

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