Custom Prebuilt

Custom Prebuilt

While Zeabur already includes many community-provided Prebuilt templates (Prebuilt Marketplace), you may need to deploy your own Docker images, configure stateful services (storage space), or use more advanced environment variable features (such as exposing a variable to other services).

For this need, Zeabur offers the custom functionality for Prebuilt.

Opening the Custom Page


You need to upgrade to a Developer plan or higher plan to use the custom functionality.

Here's how to create a simple Prebuilt service and deploy it on Zeabur.

After creating a project, click on "Create Service" → "Prebuilt" → "Custom":

Open Custom Page for Prebuilt

You will then see the custom page for Prebuilt.

Prebuilt Custom Page

Example: Deploying MariaDB

The following example will demonstrate how to deploy MariaDB using the custom functionality of Prebuilt.

MariaDB Config Example

First, enter "MariaDB" in the Service Name and paste Service Icon with the icon link of MariaDB in Docker Hub. In reality, these names and icons can be arbitrarily defined, but good naming and icons help you understand the purpose of the service. The Image is a reference to the Docker image, such as docker pull mariadb:11 referencing mariadb:11.

The Data Path is the "path that won't be cleaned up on restarting (persist)". For MariaDB, its database files are located within /var/lib/mysql, and you usually won't want the database files of the MariaDB service being removed after a restart, so you would set the Data Path to /var/lib/mysql. In Docker's concept, the Data Path is also known as "Volume" or "Persistent Volume (PV)."

The Port should be filled with MariaDB's port to allow other services (or yourself) to connect to MariaDB. According to MariaDB's configuration, both MariaDB and MySQL listen on 3306 by default, so enter 3306. Additionally, MariaDB uses TCP for connections, so change the connection port type from HTTP to TCP on the right. You can customize the name on the left. Considering this name will be used in Environment Variables, it should be kept simple without spaces or unnecessary symbols. For this example, use database.

Finally, there are the Environment Variables. The fields with variables such as ${CONTAINER_HOSTNAME} can introduce other service variables, project-exposed variables, and the values of special variables. In the example image above:

  • ${MARIADB_ROOT_PASSWORD} introduces the variable MARIADB_ROOT_PASSWORD for this service, which in this example is ${PASSWORD}.
  • ${PASSWORD} introduces the unique random password generated by Zeabur for this service.

You can use the variables ${MARIADB_USERNAME} and ${MARIADB_PASSWORD} in other services where these are selected as Exposed. When Readonly is checked, it can be restricted to prevent accidental editing of this variable value in the "Variable" section.

After verifying that all fields are correct, click "Create" to create MariaDB.

Description of Each Field

  • Service Name: The name of this Prebuilt service.
  • Service Icon: The icon of this Prebuilt service.
  • Data Path: The path where Prebuilt will continuously retain data. Leaving it blank will not create this space, reducing the performance impact of retained data.
  • Image: The Docker image reference for the Prebuilt service, such as mariadb:11.
  • Ports: The connection ports to be exposed to the public network or other services.
    • Port Name is used to identify the name of this connection port. Only English, numbers, and hyphens can be used.
    • Port Type is the type of connection port, currently supporting TCP, UDP, and HTTP.
      • Only HTTP can be bound to a domain name.
  • Environment Variables: Environment variables
    • Can be selected as Exposed to other services or as Readonly
    • The names of environment variables can only use English, numbers, and underscores.
    • Use the ${VARIABLE} syntax to reference other exposed environment variables or special variables.