---
title: "How to Deploy an App With a Dockerfile | Hostman Docs"
description: "Learn how to deploy any application on Hostman App Platform regardless of the framework used to build the app."
---

> For the complete documentation index for AI agents, see [llms.txt](https://hostman.com/llms.txt).

Using Dockerfile, you can deploy any application on App Platform regardless of the framework used to build the app.

## Requirements

-   The Dockerfile can be located either in the repository root or in the directory specified in the **Project Directory Path** field. The Dockerfile must contain the instructions required to build and run the application.
-   You must specify the `EXPOSE` parameter in the Dockerfile so that Hostman can determine which port Nginx should listen on. If `EXPOSE` is not set, Nginx will listen on container port 8080 by default.
    

Example:

```shell
FROM python:3.6
MAINTAINER Name Name "mail@mail.com"
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
ENTRYPOINT ["python"]
CMD ["app.py"]
EXPOSE 3478
```

-   You can set environment variables in the Dockerfile or in the Hostman dashboard when creating a new app.
    

## Step 1. Connect Your Repository

You can connect a repository in one of two ways:

**From your GitHub, GitLab, or BitBucket account**

1.  Click on the platform name.
2.  Log in to your account.
3.  Select the desired repository in your Hostman dashboard.

If you are already logged in, Hostman will immediately show the available repositories. Choose the one you need.

**By URL**

You can connect any repository from any platform by providing its Git URL.

1.  Click **Connect the repository via URL**.
2.  Enter the Git URL of the repository. 
3.  If the repository is private, also enter the access details.

Read more about connecting repositories [here](https://hostman.com/docs/app-platform/connecting-repositories).

Make sure that the Framework field shows the **Dockerfile** option.

## Step 2. Select Branch and Commit

**Branch**

Select a branch for deployment. 

The menu displays the 200 most recent branches, as well as the default branch (`master`, `main`, or `default`) if the repository is connected via GitHub, GitLab, or Bitbucket.

**Commit**

Leave the **Build by the last executed commit** option enabled if you want App Platform to deploy the latest commit and automatically rebuild the application when you add new commits to the repository. You can [disable automatic deployment](https://hostman.com/docs/app-platform/deployments/#enable-or-disable-autodeploy) in the future.

If you want to select a specific commit, disable this option. Note that it will also disable automatic deployments.

## Step 3. Select Server Region and Configuration

**Region**

Your application must run on a separate cloud server. Select the region where the server should be located.

**Configuration**

Select the server configuration. You can always [upgrade](https://hostman.com/docs/app-platform/managing-apps/#change-the-plan) your server later, however, downgrading will not be possible.

## Step 4. Configure **Additional Settings**

Click **Show advanced settings** to configure additional parameters. 

App Platform reads the parameters set in the Dockerfile and builds the application accordingly. 

Here you can also add the app to a private network, specify the project directory path, and set up the [health check path](https://hostman.com/docs/app-platform/healthcheck-path/) and [environment variables](https://hostman.com/docs/app-platform/variables/). If the health check or variables are already defined in the Dockerfile, there's no need to duplicate them here.

> [!NOTE]
> Note: you can't change the private network once the app is deployed. Every other setting here can be [updated](https://hostman.com/docs/app-platform/deployments/#deploy-with-new-parameters) later, and you can redeploy the app with the new parameters. 

**Private Network**

You can add the application to a private network and specify the IP address the app will use.

Apps with a private IP address may experience a short downtime during redeployment, as existing ports need to be freed up before the new version starts.

**Project Directory Path**

If the Dockerfile is located in the repository root, leave the **Project Directory Path** field empty.

If the Dockerfile is located in a subdirectory, specify the path to that directory relative to the repository root. This path is used both as the location of the Dockerfile and as the build context.

**Health Check Path**

App Platform uses the health check path to periodically verify that your application is running and functioning correctly. 

See more [here](https://hostman.com/docs/app-platform/healthcheck-path/).

**Environment Variables**

Use variables to store and pass configuration values such as passwords, file paths, and tokens. 

See more [here](https://hostman.com/docs/app-platform/variables/).

## Step 5. Enter the App Information

Here you can specify a name and a comment for your application to be displayed in the Hostman dashboard. You can also select a project to add the app to.

These settings can also be changed later.

## Step 6. Deploy

Click **Create**. Once the process starts, you will see the deployment log on the **Deploy** tab.

The deploy log contains all the necessary information to solve possible issues. If something goes wrong, for example, due to errors in the code, the deploy log will display the notification about it specifying the cause of the problem.

When you first deploy a project, the server installation may take some time. Once the process is completed, the application status will be updated, and you will also see a message about this in the log.

All done!

You can find the application's IP address and the technical domain linked to the app in the **Dashboard** tab. To link your own domain to the app, follow [this guide](https://hostman.com/docs/app-platform/domains/).

The application runs on ports 80 and 443.

In the future, App Platform will monitor updates in the repository and, if [automatic deployment](https://hostman.com/docs/app-platform/deployments/#enable-or-disable-autodeploy) is enabled, automatically rebuild the project with new changes.
