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:

- Cargo.lock
- target/
- git

📌 Use a .discloudignore file to automatically exclude these files.

🔗 Need help setting up your Cargo.toml or find main file?


🌐 Hosting Your Site with Rocket

Before deploying your website or API on Discloud, ensure that you meet the following requirements:


🚀 Configuring Rocket

Rocket is a web framework for Rust that requires the nightly version of Rust. To set up and deploy a Rocket project on Discloud, follow these steps:

1

Set the Nightly Version of Rust.

Run the following command in the terminal to ensure your project is using the nightly version:

rustup override set nightly
2

Create the rust-toolchain.toml File.

To make sure the nightly version of Rust is used, create a file named rust-toolchain.toml in the project’s root directory with the following content:

rust-toolchain.toml
[toolchain]
channel = "nightly"

This file tells rustup to use the nightly version of Rust.


✍️ Deploying Your Application

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

Last updated