# How to Use Zeabur for One-Click Deployment of LunaTV

> Deploy LunaTV on Zeabur with one click. This guide shows how to effortlessly launch a secure, CDN-accelerated streaming interface using Zeabur's automated deployment.

- Repository: [MoonTechLab/LunaTV](https://github.com/MoonTechLab/LunaTV)
- Tags: how-to-guide
- Published: 2026-09-09

---

**Deploy LunaTV on Zeabur by clicking the "Deploy on Zeabur" button, which automatically provisions a Kvrocks container for data persistence and a LunaTV Next.js container, requiring only environment variable configuration to launch a fully secured, CDN-accelerated streaming interface.**

LunaTV is a Next.js 14 application packaged as a Docker image and distributed through the GitHub Container Registry. This guide explains how to use Zeabur for one-click deployment of LunaTV, leveraging automated container orchestration to eliminate manual build steps while instantiating a production-ready environment with HTTPS and internal service discovery.

## Prerequisites

Before initiating deployment, ensure you have:

- A **Zeabur account** (free tier supports both required services)
- Access to the **LunaTV GitHub repository** at `MoonTechLab/LunaTV`

## Step-by-Step Zeabur Deployment Process

The official [`README.md`](https://github.com/MoonTechLab/LunaTV/blob/main/README.md) (lines 84–144) defines a two-service architecture. Zeabur’s one-click template automates this setup, but understanding the manual steps ensures proper configuration.

### 1. Initiate One-Click Deployment

Click the **Deploy on Zeabur** button in the repository or navigate directly to the template URL. Zeabur instantly creates a new project namespace and prepares the container orchestration layer.

Alternatively, embed this HTML in your documentation to trigger deployment:

```html
<a href="https://zeabur.com/templates/8MPTQU/deploy" target="_blank">
  <img src="https://zeabur.com/button.svg" alt="Deploy on Zeabur" />
</a>

```

### 2. Configure the Kvrocks Service

Kvrocks provides the Redis-compatible storage backend required for persisting playback history, favorites, and user session data.

According to [`README.md`](https://github.com/MoonTechLab/LunaTV/blob/main/README.md) lines 84–96, configure the service with these specifications:

- **Image**: `apache/kvrocks`
- **Port**: `6666`
- **Persistent Volume**: `/var/lib/kvrocks/db`

Mounting the volume at `/var/lib/kvrocks/db` ensures data survives container restarts and redeployments.

### 3. Configure the LunaTV Service

Add the main application container using the pre-built image defined in the repository’s `Dockerfile`.

As specified in lines 98–102 of [`README.md`](https://github.com/MoonTechLab/LunaTV/blob/main/README.md):

- **Image**: `ghcr.io/moontechlab/lunatv:latest`
- **Port**: `3000`

This container runs the Next.js 14 application defined in [`src/app/layout.tsx`](https://github.com/MoonTechLab/LunaTV/blob/main/src/app/layout.tsx) and optimized via [`next.config.js`](https://github.com/MoonTechLab/LunaTV/blob/main/next.config.js).

### 4. Set Environment Variables

Configure the connection between LunaTV and Kvrocks using Zeabur’s environment variable dashboard (referencing lines 104–124 of [`README.md`](https://github.com/MoonTechLab/LunaTV/blob/main/README.md)):

**Required variables:**

```text
USERNAME=admin
PASSWORD=your_secure_password
NEXT_PUBLIC_STORAGE_TYPE=kvrocks
KVROCKS_URL=redis://apachekvrocks:6666

```

**Optional customization variables:**

```text
SITE_BASE=https://your-domain.zeabur.app
NEXT_PUBLIC_SITE_NAME=LunaTV Enhanced
ANNOUNCEMENT=Welcome to LunaTV!

```

The hostname `apachekvrocks` resolves internally within the Zeabur project network, eliminating the need for public IP addresses or manual networking configuration.

### 5. Deploy and Configure Domain

Click deploy (lines 126–132). Zeabur pulls both images, establishes the internal network bridge, and builds the Next.js application automatically.

For domain configuration (lines 134–144), either generate a free `*.zeabur.app` subdomain with automatic CDN acceleration or bind a custom domain—Zeabur provisions SSL certificates without manual intervention.

## Local Testing with Docker Compose

Validate your configuration locally using a setup that mirrors Zeabur’s architecture. The repository includes [`docker-compose.dev.yml`](https://github.com/MoonTechLab/LunaTV/blob/main/docker-compose.dev.yml), or use this minimal configuration:

```yaml
services:
  kvrocks:
    image: apache/kvrocks
    container_name: kvrocks
    restart: unless-stopped
    volumes:
      - kvrocks-data:/var/lib/kvrocks/db
    ports:
      - "6666:6666"

  lunatv:
    image: ghcr.io/moontechlab/lunatv:latest
    container_name: lunatv
    restart: on-failure
    ports:
      - "3000:3000"
    environment:
      USERNAME: admin
      PASSWORD: admin_password
      NEXT_PUBLIC_STORAGE_TYPE: kvrocks
      KVROCKS_URL: redis://kvrocks:6666
    depends_on:
      - kvrocks

volumes:
  kvrocks-data:

```

This composition replicates the production networking topology, with LunaTV connecting to Kvrocks via the internal Docker network at `redis://kvrocks:6666`.

## Understanding the Container Architecture

Zeabur deploys LunaTV as a multi-container Pod. The `ghcr.io/moontechlab/lunatv:latest` image encapsulates the Next.js runtime environment, while `apache/kvrocks` provides the persistent layer. Because both services share the same Zeabur project namespace, they communicate via internal DNS resolution at `apachekvrocks:6666`, bypassing external latency and security exposure. The `Dockerfile` in the repository root defines the production build process that Zeabur executes automatically.

## Summary

- Zeabur’s one-click deployment creates two containers: the LunaTV Next.js application (`ghcr.io/moontechlab/lunatv:latest`) and a Kvrocks data store (`apache/kvrocks`)
- Set `KVROCKS_URL` to `redis://apachekvrocks:6666` to leverage Zeabur’s internal service discovery
- Required environment variables include `USERNAME`, `PASSWORD`, and `NEXT_PUBLIC_STORAGE_TYPE=kvrocks`
- HTTPS and global CDN acceleration are automatic, requiring zero manual certificate management
- Local development mirrors production using [`docker-compose.dev.yml`](https://github.com/MoonTechLab/LunaTV/blob/main/docker-compose.dev.yml) or equivalent compose configurations

## Frequently Asked Questions

### What is Kvrocks and why does LunaTV use it?

Kvrocks is a Redis-compatible key-value store that persists user playback history, favorites, and application state. LunaTV uses Kvrocks instead of in-memory storage to ensure data survives container restarts and redeployments, as implemented in the storage layer configuration.

### Can I substitute standard Redis for Kvrocks?

Yes. Since Kvrocks maintains Redis protocol compatibility, you can replace the `apache/kvrocks` image with a standard Redis service by updating the `KVROCKS_URL` environment variable to point to your Redis host. However, the official [`README.md`](https://github.com/MoonTechLab/LunaTV/blob/main/README.md) recommends Kvrocks for optimal storage efficiency.

### Does Zeabur charge for hosting LunaTV?

Zeabur offers a free tier sufficient to run both the LunaTV and Kvrocks containers simultaneously. Custom domain binding and advanced CDN features may require paid plans depending on Zeabur’s current pricing structure.

### How do I update LunaTV after the initial deployment?

Zeabur monitors the `ghcr.io/moontechlab/lunatv:latest` tag. To update, redeploy the LunaTV service in the Zeabur dashboard to pull the newest image. Alternatively, configure automatic deployment triggers to restart the container when the image registry updates.