This guide shows how to deploy a Solid Start app. To do so, follow these steps:
-
Install the CLI. Use the unikraft CLI or the legacy kraft CLI. You need a BuildKit builder. The easiest way to get one is via Docker. Alternatively, you can also directly set up and use BuildKit, see the quick start.
Note: The unikraft CLI is the current standard, while kraft is the legacy version. Choose one of the CLIs below and only run the commands associated with it for the rest of this guide.
-
Clone the
examplesrepository andcdinto theexamples/httpserver-node21-solid-start/directory:git clone https://github.com/unikraft-cloud/examples cd examples/httpserver-node21-solid-start/
Make sure to log into Unikraft Cloud and pick a metro close to you.
This guide uses fra (Frankfurt, π©πͺ):
Using the unikraft CLI (Recommended)
unikraft loginor
Using the legacy kraft CLI
# Set Unikraft Cloud access token
export UKC_TOKEN=token
# Set metro to Frankfurt, DE
export UKC_METRO=fraWhen done, invoke the following command to deploy this app on Unikraft Cloud:
Using the unikraft CLI (Recommended)
unikraft build . --output <my-org>/httpserver-node21-solid-start:latest
unikraft run --metro fra \
-m 512M \
-p 443:3000/tls+http \
--scale-to-zero policy=on,cooldown-time=1000 \
--image <my-org>/httpserver-node21-solid-start:latestor
Using the legacy kraft CLI
kraft cloud deploy \
-M 512Mi \
-p 443:3000/tls+http \
--scale-to-zero on \
--scale-to-zero-cooldown 1s \
.The output shows the instance address and other details:
Using the unikraft CLI (Recommended)
metro: fra
name: httpserver-node21-solid-start-lvoa2
uuid: 4e6ccb1f-0533-4dc1-be67-eca8dfc1f8c6
state: starting
image: <my-org>/httpserver-node21-solid-start
resources:
memory: 512MiB
vcpus: 1
service:
uuid: 46865b94-fd59-7d38-485d-c110a41b0949
name: long-star-1tms9h1z
domains:
- fqdn: long-star-1tms9h1z.fra.unikraft.app
networks:
- uuid: 1b8eccba-a635-e4db-3a3f-162fbe1f692f
private-ip: 10.0.6.8
mac: 12:b0:8e:29:47:83
timestamps:
created: just now
or
Using the legacy kraft CLI
[β] Deployed successfully!
β
ββββββββββ name: httpserver-node21-solid-start-lvoa2
ββββββββββ uuid: 4e6ccb1f-0533-4dc1-be67-eca8dfc1f8c6
βββββββββ metro: https://api.fra.unikraft.cloud/v1
βββββββββ state: starting
ββββββββ domain: https://long-star-1tms9h1z.fra.unikraft.app
βββββββββ image: oci://unikraft.io/<my-org>/httpserver-node21-solid-start@sha256:eb2e79b2fc5c28bb43923a1fc4931db94ebc3f939a6fbe00d06189c0ae2e02fd
ββββββββ memory: 512 MiB
βββββββ service: long-star-1tms9h1z
ββ private fqdn: httpserver-node21-solid-start-lvoa2.internal
ββββ private ip: 10.0.6.8
In this case, the instance name is httpserver-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:
Using the unikraft CLI (Recommended)
unikraft instances listMETRO NAME STATE IMAGE ARGS MEMORY VCPUS FQDN CREATED
fra httpserver-node21-solid-start-lvoa2 running <my-org>/httpserver-node21-solid-start 512MiB 1 long-star-1tms9h1z.fra.unikraft.app 2 minutes ago
or
Using the legacy kraft CLI
kraft cloud instance listNAME FQDN STATE STATUS IMAGE MEMORY VCPUS ARGS BOOT TIME
httpserver-node21-solid-start-lvoa2 long-star-1tms9h1z.fra.unikraft.app running 1 minutes ago oci://unikraft.io/<my-org>/httpserver-node21-solid-start@sha256... 512 MiB 1 67.65 ms
When done, you can remove the instance:
Using the unikraft CLI (Recommended)
unikraft instances delete httpserver-node21-solid-start-lvoa2or
Using the legacy kraft CLI
kraft cloud instance remove httpserver-node21-solid-start-lvoa2To customize the app, update the files in the repository, listed below:
Kraftfile: the Unikraft Cloud specificationDockerfile: the Docker-specified app filesystemsrc/: server source files
Use the --help option for detailed information on using Unikraft Cloud:
Using the unikraft CLI (Recommended)
unikraft --helpor
Using the legacy kraft CLI
kraft cloud --helpOr visit the CLI Reference or the legacy CLI Reference.