Zudoku
Guides

Remix

This guide shows how to deploy a Remix app.

To do so, 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/node21-remix/ directory:

TerminalCode
git clone https://github.com/kraftcloud/examples cd examples/node21-remix/

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

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

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

The output shows the instance URL and other details:

TerminalCode
[โ—] Deployed successfully! โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ name: node21-remix-jvj6b โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ uuid: 4e6ccb1f-0533-4dc1-be67-eca8dfc1f8c6 โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ state: running โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ url: https://long-star-1tms9h1z.fra0.kraft.host โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ image: node21-remix@sha256:300eefce3de136ad9c782f010b69da01100ae5f0ca17f038f92321d735d6675f โ”œโ”€โ”€โ”€โ”€โ”€ boot time: 153.47 ms โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ memory: 512 MiB โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€ service: long-star-1tms9h1z โ”œโ”€โ”€ private fqdn: node21-remix-jvj6b.internal โ”œโ”€โ”€โ”€โ”€ private ip: 172.16.6.8 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ args: /usr/bin/node /usr/src/server.js

In this case, the instance name is node21-remix-jvj6b and the URL is https://long-star-1tms9h1z.fra0.kraft.host. They are different for each run. You can now point your browser at the URL to see your deployed instance.

At any point in time, you can list information about the instance:

TerminalCode
kraft cloud instance list
Code
NAME FQDN STATE CREATED AT IMAGE MEMORY ARGS BOOT TIME node21-remix-jvj6b long-star-1tms9h1z.fra0.kraft.host running 1 minutes ago node21-rem... 256 MiB /usr/bin/node /usr/src/server... 67.65 ms

When done, you can remove the instance:

TerminalCode
kraft cloud instance remove node21-remix-jvj6b

Customize your Application

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

  • Kraftfile: the Unikraft Cloud specification
  • Dockerfile: the Docker-specified application filesystem
  • server.js: the server itself

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