> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hivenet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to use custom templates

> Learn how to create and manage custom templates on Compute with Hivenet for reusable container configurations.

Custom templates let you save and reuse container configurations for your compute jobs. Instead of manually setting up the same environment each time, you can create a template once and launch new instances from it whenever you need.

## Why use custom templates

* **Save time**: No need to retype registry paths, variables, or commands every time.
* **Stay consistent**: Make sure all your instances use the same base image and environment.
* **Reuse securely**: Keep sensitive values as secrets so they’re injected only at runtime.

## Creating a new template

You can create a custom template directly in the Compute console when launching a new **container** instance. Select **New template** under the *Pick a template* step.

### General settings

* **Name** – Choose a clear, descriptive name for your template.
* **Instance type** – Select whether this template is for a **GPU** or **CPU** instance.
* **Visibility** – Templates are **Private** by default (only you can see and use them). Public templates will be available in the future.

<img src="https://mintcdn.com/hivenet/di7961sreSR53OLg/images/custom-templates-1.png?fit=max&auto=format&n=di7961sreSR53OLg&q=85&s=826320bb1d30dab3a9f0e779130236ab" alt="Custom Templates 1 Pn" width="1464" height="1952" data-path="images/custom-templates-1.png" />

### Container configuration

* **Registry** – Provide the full path to your container image (for example, `docker.io/library/nginx:latest`).
* **Registry credentials** – Enable this option if you’re using a private registry that requires authentication.

### Environment variables

Define environment variables as `KEY=value` pairs. You can add:

* **Variables** – Standard environment values.
* **Secrets** – Sensitive keys (e.g., API tokens). Secrets are injected securely at runtime.

### Instructions for base images

When building your template, you can use the provided Hivenet base image and setup script:

```dockerfile theme={null}
FROM 993cz8u0.c1.gra9.container-registry.ovh.net/hive-compute-public/base-ubuntu:latest
CMD ["/usr/local/bin/setup_instance.sh"]
```
