---
title: "7 Steps to Create A Custom Extension in IP Fabric 7.0"
id: "23704"
type: "post"
slug: "create-a-custom-extension-in-ip-fabric-7-0"
published_at: "2025-03-07T15:28:01+00:00"
modified_at: "2025-03-10T21:42:39+00:00"
url: "https://ipfabric.io/blog/create-a-custom-extension-in-ip-fabric-7-0/"
markdown_url: "https://ipfabric.io/blog/create-a-custom-extension-in-ip-fabric-7-0.md"
excerpt: "Learn how to build and deploy a custom extension in IP Fabric 7.0 with this step-by-step guide."
taxonomy_category:
  - "Integrations"
taxonomy_post_tag:
  - "Network automation"
---

# 7 Steps to Create A Custom Extension in IP Fabric 7.0

Learn how to build and deploy a custom extension in IP Fabric 7.0 with this step-by-step guide.

[https://ipfabric.io/author/ipf-team/](https://ipfabric.io/author/ipf-team/)
[IPF Team](https://ipfabric.io/author/ipf-team/)

Published

7 Mar 2025

Updated

10 Mar 2025

In our [last blog](https://ipfabric.io/blog/ip-fabric-7-0-extensions/)
, we covered how you can use extensions to run custom applications directly within the [IP Fabric 7.0](https://ipfabric.io/blog/ip-fabric-7-0/)
 user interface. Now let’s take it a step further by building a simple ‘Hello, World’ extension from scratch.

This hands-on guide will walk through the process of setting up and deploying your first extension in IP Fabric. Here’s what we’ll cover:

- Writing a basic Python script for an extension.
- Setting up a [Dockerfile](https://docs.ipfabric.io/main/releases/release_notes/7.0/?h=dockerfile#extensions-engineering-preview) to containerize it.
- Deploying an extension in IP Fabric.

Ready? Let’s dive in.

## How to Build Your Own Extension in 7 Steps

### Step 1: Start in an Empty Directory

We need a clean working directory to organize our extension files. Run `ls -alt` to verify that the directory is empty before proceeding with the following:

```
❯ ls -alt
total 0
drwxr-xr-x@ 11 cristiancordero staff 352 Feb 10 16:43 ..
drwxr-xr-x@ 2 cristiancordero staff 64 Feb 10 16:43 .
```

### Step 2: Create a Simple ‘Hello, World’ Script

This Python script prints `Hello from hello_world.py!` to the terminal:

```
def main() -> None:
    print("Hello from hello_world.py!")

if __name__ == "__main__":
    main()
```

### Step 3: Create a DockerFile

We need a Dockerfile to run our extension as a containerized application. This Dockerfile will:

- Use Python Slim as the base image for efficiency.
- Copy our script into the container.
- Install uv, a modern dependency manager.
- Set up the entry point to run our script.

Speaking of our DockerFile:

```
FROM python:slim
WORKDIR /app
COPY . .
EXPOSE 80
RUN apt update && apt upgrade -y
# install UV
RUN pip install uv
ENTRYPOINT ["uv" , "run", "/app/hello_world.py"]
```

After running the above, your directory should look like this:

```
❯ ls -alt
-rw-r--r--@  1 cristiancordero  staff   172 Feb 10 19:53 Dockerfile
-rw-r--r--@  1 cristiancordero  staff   223 Feb 10 18:59 hello_world.py
drwxr-xr-x@  9 cristiancordero  staff   288 Feb 10 18:55 .
drwxr-xr-x@ 11 cristiancordero  staff   352 Feb 10 16:43 ..
```

### Step 4: Build the Dockerfile

Before we can run our extension, we need to build a [Docker image](https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-an-image/)
 from our [Dockerfile](https://docs.docker.com/build/concepts/dockerfile/)
 using this command:

```
docker build --progress=plain -t ipf_extensions_hello_world .
```

This process will:

- Pull the base Python image (python:slim).
- Copy our script into the container.
- Install necessary dependencies (uv).
- Define how the extension runs inside the container.

### Step 5: Test the Docker Image

Run a test with the following command:

```
docker run ipf_extensions_hello_world
```

###### Output:

```
Downloading cpython-3.12.2-linux-aarch64-gnu (24.4MiB)Downloaded cpython-3.12.2-linux-aarch64-gnuDownloading pydantic-core (1.7MiB)Downloaded pydantic-coreInstalled 14 packages in 17msHello from hello_world.py!
```

The output will confirm that our containerized script is executing as expected, which means that we have successfully built and run our first extension.

### Step 6: Zip the Files

In the command below, we save the files `Dockerfile` and `hello_world.py` to a zipped file called `ipf_extension.zip`.

If you’re on macOS or Linux:

```
zip ipf_extension.zip Dockerfile hello_world.py
```

###### Output:

```
updating: Dockerfile (deflated 15%)
updating: hello_world.py (deflated 25%)
```

Now that we’ve zipped the necessary files, the final step is to upload and activate our extension in IP Fabric.

### Step 7: Deploy to IP Fabric

Activate our extension by accessing the **“**Extensions” tab in [IP Fabric 7.0 or later](https://docs.ipfabric.io/7.0/)
, clicking **“**Add,” and dropping your zipped file.

You should see `Hello from hello_world.py!` when you call your script.

## What’s Next for Extensions?

By following these steps, you’ve learned the fundamentals of creating, containerizing, and running an extension within the IP Fabric platform.

Future posts in ou*r *“*Extensions 101”* series will dive deeper into more advanced use cases, optimizations, and ways to extend IP Fabric’s capabilities even further. Stay tuned!

## Related Resources

Integrations

### [4 Steps To Map Application Dependencies To Critical Infrastructure](https://ipfabric.io/blog/map-application-dependencies-in-4-steps/)

Use IP Fabric's application infrastructure mapping capabilities to trace application dependencies across network, cloud, and host-level infrastructure.

Integrations

### [Application To Infrastructure Mapping 101](https://ipfabric.io/blog/application-to-infrastructure-mapping/)

Protect critical applications across on-prem and cloud environments using IP Fabric's new application-to-infrastructure mapping capabilities.

Integrations

### [IP Fabric Partners With Illumio to Unify Cloud, Network, and Application Visibility](https://ipfabric.io/blog/illumio-partnership-network-application-visibility/)

This industry-first collaboration will help customers to correlate application and workload context with a digital twin of cloud and network behavior.
