Caddy is an extensible server platform that uses TLS by default. This guide walks you through setting up, deploying, and launching the Caddy web server on the Akash Network. We’ll use the official Docker image for Caddy and leverage your provided SDL template to craft the deployment configuration.
Prerequisites
- Install Akash CLI: Follow the official guide to set up the Akash CLI.
- Create an Akash Wallet: If you don’t already have an Akash wallet, use the wallet creation guide to set one up.
- Fund Your Wallet: Fund your Akash wallet with AKT tokens to pay for deployments.
- Install Docker: Ensure Docker is installed and running on your local machine.
- Install a Code Editor: Use an editor like VSCode for editing SDL files.
Step 1: Prepare the SDL File (deploy.yaml)
Below is an example SDL file (deploy.yaml) for deploying Caddy using its official Docker image:
Notes:
- image: Uses the official Caddy Docker image.
- port: Caddy listens on port 80 globally.
- resources: Allocates minimal CPU, memory, and storage resources.
- pricing: Defines a base price for deployment.
Step 2: Deploy Using Akash CLI
- Validate the SDL File:
- Create Deployment:
- Query Lease: After creating the deployment, query the lease to ensure it’s active:
- Access the Deployment: Note the endpoint provided in the lease logs. Use this URL to access your Caddy instance.
For detailed steps on using the CLI, refer to the Akash CLI Deployment Guide.
Step 3: Deploy Using Akash Console
-
Access the Akash Console: Go to https://console.akash.network.
-
Login: Connect your Akash wallet to the console.
-
Create Deployment:
- Upload the deploy.yaml file.
- Follow the prompts to set pricing and finalize the deployment.
-
Monitor Deployment: Use the console to monitor logs and obtain the deployment’s public endpoint.
For more details, follow the Akash Console Guide.
Step 4: Verify and Launch Caddy
-
Test the Endpoint: Visit the public endpoint URL from your lease logs or the Akash console. You should see Caddy’s default web page.
-
Customize Caddy:
- Create a Caddyfile for custom configurations.
- Update the Docker image to mount your Caddyfile.
-
Redeploy if Necessary: Update your SDL file and redeploy for any configuration changes.
Troubleshooting
- Common Deployment Issues: https://docs.akash.network/guides/deploy/troubleshooting
- Akash Discord Support: Join Akash Discord for community help.