# How to create a subdomain?

## 🌐 What is a Discloud Subdomain?

On **Discloud**, any app that uses a **port** and requires **external access** through it to be accessed is considered a site. This includes bots with dashboards, dashboards, APIs, static and dynamic sites, and many others…

To allow external access to your app, Discloud offers the option to create a **custom subdomain**. This subdomain redirects traffic through the Discloud proxy to **port 8080** of your app, allowing you and users to access your site **securely and reliably**.

### 📡 How it Works

<figure><img src="/files/btvw2KAcDmEGSuLzPKHS" alt="Discloud subdomain flow"><figcaption></figcaption></figure>

***

## ✅ Requirements

To register and use a Discloud subdomain, you must meet the following requirements:

{% hint style="success" %}
[Platinum Plan or Higher](https://discloud.com/plans) is required to host websites or APIs.
{% endhint %}

{% hint style="success" %}
**Port 8080** – Your application must listen on port 8080 for external traffic
{% endhint %}

{% hint style="success" %}
**Discloud Config** – Your app must include a properly configured [`discloud.config`](/en/configurations/discloud.config.md) file
{% endhint %}

***

## 🚀 Register Your Subdomain

{% stepper %}
{% step %}
Open the [**Discloud Dashboard**](https://discloud.com/dashboard).
{% endstep %}

{% step %}
Click on the `Subdomain` tab at the top of the application page.

<figure><img src="/files/57NgeShliRQqpJyCQ9kq" alt="Dashboard Subdomain tab"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click the `+ Subdomain` button to create a new subdomain.

<figure><img src="/files/Yn3dq2xUeorS7Ciiqh8p" alt="Add Subdomain button"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Enter your desired subdomain name (e.g., `myapp`, `dashboard`, `api`).

{% hint style="info" %}

#### **Subdomain naming rules**

* Maximum **20 characters**
* Only alphanumeric characters (A–Z, 0–9) and hyphens (-)
* No spaces, underscores, or special characters allowed
  {% endhint %}
  {% endstep %}

{% step %}
Your subdomain is now registered and its state will show as **Available**.
{% endstep %}
{% endstepper %}

***

## 📝 Configure Your [discloud.config](/en/configurations/discloud.config.md)

Once your subdomain is registered, you **must** add it to your `discloud.config` file so Discloud routes traffic to the correct app.

Open your `discloud.config` file and locate the `ID` field:

```ini
ID=yoursubdomain
```

{% hint style="warning" %}

#### **How to specify the subdomain in the `discloud.config` file?**

Use only the subdomain name, **not** the full domain (e.g., use `myapp`, not `myapp.discloud.app`).

Example:

<pre class="language-ini" data-title="discloud.config"><code class="lang-ini"><strong>ID=myapp
</strong>TYPE=site
<a data-footnote-ref href="#user-content-fn-1"># ...</a>
</code></pre>

{% endhint %}

After updating `discloud.config`, **deploy your application** for the changes to take effect.

{% content-ref url="/pages/xVqMa6zo7nc967JtePJ0" %}
[How to Host, Using](/en/how-to-host-using/dashboard.md)
{% endcontent-ref %}

***

## 🔄 Subdomain States

Your registered subdomain can have two states:

{% hint style="info" %}

#### **🔵 Active**

* The subdomain is **registered and in use**.
* An app is currently deployed and accessible at `https://yoursubdomain.discloud.app`.
* Traffic is being routed to your app on port 8080.
  {% endhint %}

{% hint style="info" %}

#### **🟢 Available**

* The subdomain is **registered and available**.
* No app is currently using it.
* You can deploy an app to activate it at any time.
  {% endhint %}

***

## 🌍 Access Your Site

Once your subdomain is **Active**, you can access it via:

```
https://yoursubdomain.discloud.app
```

***

## ⚙️ Custom Domain

If you want to use your own domain (e.g., `yourdomaind.com`) instead of a Discloud subdomain, check:

{% content-ref url="/pages/mAM4xEwvrVKyPbbJ1ikt" %}
[Custom Domain](/en/api-and-integrations/custom-domain.md)
{% endcontent-ref %}

[^1]: **Note:** The ... only indicate the continuation of other previous or subsequent options that are not relevant to mention on this page.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.discloud.com/en/faq/general-questions/how-to-create-a-subdomain.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
