Skip to main content

Quickstart

Welcome to Molnett! This guide will walk you through installing the Molnett CLI (molnctl), logging in, setting up your context, and deploying your first stateless application.

Prerequisites

  • A Molnett account. If you don't have one yet, please sign up at https://console.molnett.app.
  • Docker installed and running on your local machine.

Step 1: Install molnctl

molnctl is the Molnett Command Line Interface, written in Rust.

  • Recommended: Download pre-compiled binaries from the Molnctl GitHub Releases page. Extract and place molnctl in your PATH.
  • Alternative: Compile from source using Rust (see molnctl README for instructions).

Verify Installation:

molnctl version

Step 2: Log in and Select Tenant

  1. Log in:

    molnctl auth login

    Follow the browser prompts.

  2. Select Tenant: Your tenant is your primary account/organization.

    # List your tenants
    molnctl tenants list

    # Switch to your desired tenant (prompts if name omitted)
    molnctl tenants switch <your-tenant-name>

    (If you only have one tenant, it might be selected by default after login. molnctl tenants list will confirm.)

Step 3: Prepare Application & Push to Molnett Registry

Molnett provides an integrated Docker registry per project at oci.se-ume.mltt.art.

1. Create a Dockerfile for your application.

Example (Node.js):

FROM node:18-alpine
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD ["node", "your-app-entrypoint.js"]

2. Log in to Molnett's Docker Registry: This uses your Molnett CLI session.

molnctl auth docker

This command configures Docker to authenticate with oci.se-ume.mltt.art (username x, password is your Molnett token).

3. Define Project and Image Details: You need your Project ID to tag your image. (Placeholder: How to get Project ID? Assuming molnctl projects list shows it, or there's a molnctl projects get <n> command.)

# First, ensure you have a project selected or create one:
# $ molnctl projects list
# $ molnctl projects create my-first-project (if needed, then it becomes the default)
# $ molnctl projects switch my-first-project (if switching to an existing one)

# Assume your Project ID is retrieved and set here:
PROJECT_ID="your-actual-project-id" # Replace this!
IMAGE_NAME="my-quickstart-app"
IMAGE_TAG="v1"
REGISTRY_IMAGE_PATH="oci.se-ume.mltt.art/${PROJECT_ID}/${IMAGE_NAME}:${IMAGE_TAG}"

Action: You must replace your-actual-project-id above. Check molnctl projects list output for the ID.

4. Build and Push Your Image:

docker build -t ${REGISTRY_IMAGE_PATH} .
docker push ${REGISTRY_IMAGE_PATH}

Step 4: Define Your Service (molnett.yaml)

Create a molnett.yaml file in your project root.

name: my-quickstart-service # This will be the name of your service in Molnett
containers:
- name: web
image: oci.se-ume.mltt.art/YOUR_PROJECT_ID/my-quickstart-app:v1 # Use the full image path
ports:
- target: 8080 # Your app's internal port
publish: true # Expose this port publicly

Important: Replace YOUR_PROJECT_ID with your actual Project ID.

Step 5: Select Environment and Deploy

Services are deployed to a specific Environment within your selected Project and Tenant.

  1. Select Project (if not already set as default by projects create or projects switch):

    molnctl projects list
    molnctl projects switch <your-project-name-or-id>
  2. Define Target Environment: The molnctl deploy command requires an environment. You can specify this with the --env flag.

    # You can list environments to see available options or create one:
    # molnctl environments list
    # molnctl environments create development (if needed)
    TARGET_ENVIRONMENT="development" # Or your chosen environment name
  3. Deploy the Service: This command deploys the service defined in ./molnett.yaml (by default) to the specified environment.

    molnctl deploy --env ${TARGET_ENVIRONMENT}
    # To specify a different manifest file:
    # molnctl deploy --env ${TARGET_ENVIRONMENT} ./path/to/your/manifest.yaml

Molnett will deploy your application. A public URL is provided for published ports.

Step 6: Check Service Status and Logs

Make sure you have the correct tenant and project context set. Specify the environment for these commands.

# List services in the environment
molnctl services list --env ${TARGET_ENVIRONMENT}

# Get details of your specific service
# (Placeholder: Assuming 'molnctl services get <n> --env <env>' or similar exists)
# molnctl services get my-quickstart-service --env ${TARGET_ENVIRONMENT}

# View logs for your service
# (Placeholder: Exact command for logs, e.g. molnctl logs <n> --env <env>, or is it a subcommand of services?)
molnctl logs my-quickstart-service --env ${TARGET_ENVIRONMENT} # Assuming top-level logs command

Congratulations! You've deployed your first application to Molnett.

Next Steps