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:
Platinum plan or higher is required to host websites or APIs.
A subdomain must be created before deployment.
Use the nightly version of Rust (Rocket requires nightly).
Port 8080
is mandatory – Applications must listen on this port.
🚀 Configuring Rocket
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:
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
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:
[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