LogoLogo
ProductResourcesGitHubStart free
  • Documentation
  • Learn
  • ZenML Pro
  • Stacks
  • API Reference
  • SDK Reference
  • Getting Started
    • Welcome to ZenML
    • Installation
    • Hello World
    • Core Concepts
    • System Architecture
  • Deploying ZenML
    • Deploy
      • Deploy with Docker
      • Deploy with Helm
      • Deploy using HuggingFace Spaces
      • Deploy with custom images
      • Secret management
      • Custom secret stores
    • Connect
      • with your User (interactive)
      • with an API Token
      • with a Service Account
    • Manage
      • Best practices for upgrading
      • Using ZenML server in production
      • Troubleshoot your ZenML server
      • Migration guide
        • Migration guide 0.13.2 → 0.20.0
        • Migration guide 0.23.0 → 0.30.0
        • Migration guide 0.39.1 → 0.41.0
        • Migration guide 0.58.2 → 0.60.0
  • Concepts
    • Steps & Pipelines
      • Configuration
      • Scheduling
      • Logging
      • Advanced Features
      • YAML Configuration
    • Artifacts
      • Materializers
      • Visualizations
    • Stack & Components
    • Service Connectors
    • Containerization
    • Code Repositories
    • Secrets
    • Tags
    • Metadata
    • Models
    • Templates
    • Dashboard
  • Reference
    • Community & content
    • Environment Variables
    • llms.txt
    • FAQ
    • Global settings
    • Legacy docs
Powered by GitBook
On this page
  • Build and Push Custom ZenML Server Docker Image
  • Deploy ZenML with your custom image

Was this helpful?

Edit on GitHub
  1. Deploying ZenML
  2. Deploy

Deploy with custom images

Deploying ZenML with custom Docker images.

PreviousDeploy using HuggingFace SpacesNextSecret management

Last updated 26 days ago

Was this helpful?

In most cases, deploying ZenML with the default zenmlhub/zenml-server Docker image should work just fine. However, there are some scenarios when you might need to deploy ZenML with a custom Docker image:

  • You have implemented a custom artifact store for which you want to enable or in your dashboard.

  • You have forked the ZenML repository and want to deploy a ZenML server based on your own fork because you made changes to the server / database logic.

Deploying ZenML with custom Docker images is only possible for or deployments.

Build and Push Custom ZenML Server Docker Image

Here is how you can build a custom ZenML server Docker image:

  1. Set up a container registry of your choice. E.g., as an indivial developer you could create a free account and then set up a free Docker Hub repository.

  2. Clone ZenML (or your ZenML fork) and checkout the branch that you want to deploy, e.g., if you want to deploy ZenML version 0.41.0, run

    git checkout release/0.41.0
  3. Copy the , e.g.:

    cp docker/base.Dockerfile docker/custom.Dockerfile
  4. Modify the copied Dockerfile:

    • Add additional dependencies:

    RUN pip install <my_package>
    • (Forks only) install local files instead of official ZenML:

    RUN pip install -e .[server,secrets-aws,secrets-gcp,secrets-azure,secrets-hashicorp,s3fs,gcsfs,adlfs,connectors-aws,connectors-gcp,connectors-azure]
  5. Build and push an image based on your Dockerfile:

    docker build -f docker/custom.Dockerfile . -t <YOUR_CONTAINER_REGISTRY>/<IMAGE_NAME>:<IMAGE_TAG> --platform linux/amd64
    docker push <YOUR_CONTAINER_REGISTRY>/<IMAGE_NAME>:<IMAGE_TAG>

Deploy ZenML with your custom image

Next, adjust your preferred deployment strategy to use the custom Docker image you just built.

Deploy a custom ZenML image via Docker

To use your own image, follow the general guide step by step but replace all mentions of zenmldocker/zenml-server with your custom image reference <YOUR_CONTAINER_REGISTRY>/<IMAGE_NAME>:<IMAGE_TAG>. E.g.:

  • To run the ZenML server with Docker based on your custom image, do

docker run -it -d -p 8080:8080 --name zenml <YOUR_CONTAINER_REGISTRY>/<IMAGE_NAME>:<IMAGE_TAG>
  • To use docker-compose, adjust your docker-compose.yml:

services:
  zenml:
    image: <YOUR_CONTAINER_REGISTRY>/<IMAGE_NAME>:<IMAGE_TAG>

Deploy a custom ZenML image via Helm

To use your own image, the only thing you need to do differently is to modify the image section of your values.yaml file:

zenml:
  image:
    repository: <YOUR_CONTAINER_REGISTRY>/<IMAGE_NAME>
    tag: <IMAGE_TAG>

If you want to verify your custom image locally, you can follow the section below to deploy the ZenML server locally first.

To deploy your custom image via Docker, first familiarize yourself with the general .

To deploy your custom image via Helm, first familiarize yourself with the general .

artifact visualizations
step logs
Docker
Helm
Docker Hub
ZenML base.Dockerfile
ZenML Docker Deployment Guide
ZenML Helm Deployment Guide
Deploy a custom ZenML image via Docker
ZenML Scarf