> For the complete documentation index, see [llms.txt](https://docs.discloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.discloud.com/en/development-environment/supported-languages/rust.md).

# Rust

Complete guide to host Rust applications on Discloud.

## 📁 **Preparing the Files**

Before uploading your project, you must **exclude unnecessary files** to optimize the deployment.

#### ❌ **Files to Exclude**

Ensure the following files and directories are **not** included in your [`.zip`](https://docs.discloud.com/en/faq/general-questions/how-to-compress.md):

```diff
- Cargo.lock
- target/
- .git/
```

📌 **Use a** [**`.discloudignore`**](https://docs.discloud.com/en/configurations/.discloudignore.md) **file** to automatically exclude these files.

🔗 **Need help setting up your** [**`Cargo.toml`**](https://docs.discloud.com/en/development-environment/supported-languages/rust/cargo.toml.md) **or finding the** [**main file**](https://docs.discloud.com/en/faq/general-questions/what-is-the-main-file.md)**?**

***

## 🌐 Hosting Your Site with Rocket

Before deploying your website or API on Discloud, ensure that you 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" %}
[A subdomain must be created](https://docs.discloud.com/en/faq/general-questions/how-to-create-a-subdomain.md) before deployment.
{% endhint %}

{% hint style="danger" %}
Port `8080` is mandatory – Applications must listen on this port.
{% endhint %}

***

## 🚀 Configuring `Rocket`

[Rocket](https://rocket.rs/) is a web framework for Rust that, since version 0.5, works on stable Rust. By default, Rocket listens on `127.0.0.1:8000`. For Discloud, create a `Rocket.toml` file in the project root so it listens on `0.0.0.0:8080`:

{% code title="Rocket.toml" %}

```toml
[default]
address = "0.0.0.0"
port = 8080
```

{% endcode %}

***

## ✍️ Deploying **Your Application**

Once your project is **configured and compressed**, you can choose one of the following **deployment methods** on Discloud:

<table data-card-size="large" data-view="cards"><thead><tr><th data-card-target data-type="content-ref"></th><th align="center"></th><th data-hidden></th><th data-hidden></th><th data-hidden></th></tr></thead><tbody><tr><td><a href="https://docs.discloud.com/en/deployment-methods/dashboard.md">Dashboard</a></td><td align="center">Upload and manage your application via the web interface.</td><td></td><td></td><td></td></tr><tr><td><a href="https://docs.discloud.com/en/deployment-methods/discord-bot.md">Discord Bot</a></td><td align="center">Deploy directly through Discloud’s Discord bot commands.</td><td></td><td></td><td></td></tr><tr><td><a href="https://docs.discloud.com/en/deployment-methods/visual-studio-code.md">Visual Studio Code</a></td><td align="center">Integrate with VS Code for seamless project management.</td><td></td><td></td><td></td></tr><tr><td><a href="https://docs.discloud.com/en/deployment-methods/cli.md">CLI</a></td><td align="center">Use the command-line interface for quick and efficient deployment.</td><td></td><td></td><td></td></tr></tbody></table>
