Skip to main content
Deploying a .NET Core app should be simple. With Clouddley, you can skip the manual setup and just connect to your Scaleway instance and start building. In this tutorial, you’ll learn how to deploy a .NET Core app on a Scaleway Instance, whether it’s for a side project or production. Let’s get started!

Prerequisites

Before you start, make sure you have:

Create a .NET Core App

In this section, you’ll create a simple .NET Core console application that prints a message to the console. If you already have an app, you can skip this step.
1

Create a .NET Core app

Open your terminal and run the following commands to create a new .NET Core application:
dotnet new console -n MyApp
cd MyApp
This command creates a new console application named MyApp and navigates into the project directory.
2

Add a simple message

Open the Program.cs file in your favorite text editor and replace its content with the following code:
using System;

namespace MyApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to ASP.NET Core!");
        }
    }
}
3

Run the app locally

Run the following command to build and run your app locally:
dotnet run
Open your browser and navigate to http://localhost:5013 to see your app in action. You should see the output: Welcome to ASP.NET Core!

Containerize Your .NET Core App

Create a Dockerfile

To deploy your .NET Core app on Scaleway using Clouddley, you need to containerize it. This involves creating a Dockerfile named triggr.dockerfile that defines how your app will run in a container. Here, you can see a simple triggr.dockerfile for a .NET Core app:
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src

# Copy csproj and restore dependencies
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o /app/publish /p:UseAppHost=false

# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
WORKDIR /app
COPY --from=build /app/publish .

# Set the port to match local dev
EXPOSE 5013

ENTRYPOINT ["dotnet", "newApp.dll"]

Building and Running the Container Locally

To test your container locally, follow these steps:
  1. Build the Docker Image:
    docker build -f triggr.dockerfile -t dotnet-app .
    
    This command builds a Docker image named dotnet-app using the triggr.dockerfile
  2. Run the Docker Container:
     docker run -p 5013:5013 -e ASPNETCORE_URLS=http://0.0.0.0:5013 dotnet-app
    
    This command runs the container, mapping port 5013 of the container to port 5013 on your local machine. You can now access your Rails app at http://localhost:5013.

Push Your App to GitHub or Bitbucket

Next, you’ll push your .NET Core app to a GitHub or Bitbucket repository. For this example, we’ll use GitHub, but you can follow similar steps for Bitbucket.
1

Create a New Repository on GitHub

Go to GitHub and create a new repository. Give it a name and leave the rest of the settings as default (no README, no .gitignore, you already have those locally).
2

Initialize Git

If you haven’t already, initialize a Git repository in your project folder:
git init
3

Add and Commit Your Code

Add your files and commit:
git add .
git commit -m "Initial commit"
4

Create branch and add Remote Repository

Create a branch and link your local repository to the GitHub repository you created:
git branch -M main
git remote add origin <your-repo-url>
5

Push code

Finally, push your code to GitHub:
git push -u origin main
Now your code is pushed to GitHub, it is ready for deployment.

Create a Scaleway instance using Scaleway CLI

  • First, install the Scaleway CLI if you haven’t already.
curl -sSL https://install.scaleway.dev | bash
  • Once installed, authenticate by running the command:
scw init
You’ll be prompted to enter your access key and secret key. You can find these in your Scaleway console under API Keys. Enter them when prompted.
  • To make sure your CLI is set up correctly, run:
scw instance server list
This command should return an empty list if you have no instances yet, or a list of your existing instances.
  • Configuring security groups is essential for controlling access to your instance. Create a security group that allows HTTP and HTTPS traffic:
scw instance security-group create name=my-sec-group description="Allow port access"
See the output below:

Creating a Security Group

  • Next, add rules to allow traffic on port 5013 (the port your .NET Core app will run on) and 22 by running the following commands:
scw instance security-group create-rule \
  security-group-id=<your-sg-id> \
  protocol=TCP \
  direction=inbound \
  action=accept \
  ip-range=0.0.0.0/0 \
  dest-port-from=5013
scw instance security-group create-rule \
  security-group-id=<your-sg-id> \
  protocol=TCP \
  direction=inbound \
  action=accept \
  ip-range=0.0.0.0/0 \
  dest-port-from=22
Replace <your-sg-id> with the ID of the security group you just created. You can find your security group ID by running the command $ scw instance security-group list and this will list all security groups.
You see the output below:

Creating a Security Group Rule

  • Now, create a Scaleway Instance:
scw instance app-server create \
name=app-server \
type=DEV1-S \
image=ubuntu_focal \
zone=fr-par-1 \
ip=new \
security-group=id=<your-sg-id>
Replace <your-sg-id> with the ID of the security group you created earlier.
This command creates a new instance named app-server with the specified type and image in the fr-par-1 zone. It assigns a new public IP address to the instance and applies the security group you created.
You should see output similar to this:

Creating a Scaleway Instance

Once the instance is ready, you can get its public IP address by running:
scw instance ip list
This command will list all IP addresses associated with your Scaleway account, including the one assigned to your new instance. Note down the public IP address of your instance.

Deploy

Now that your app is on GitHub or Bitbucket and your Scaleway instance is ready, it’s time to deploy it.
  • Open your browser, log in to your Clouddley account
  • Click on the Apps in the left sidebar.
  • Click on Deploy App to begin.

Accessing Apps


Step 1: Configure your service
  • Select your Git provider (GitHub or Bitbucket) and authorize Clouddley to access your repository. For this guide we will use Github.
  • Click on Continue with Github

Choose your Git hosting service


Step 2: Configure Git
  • To connect your Github user or organization account, click the Select username/organization dropdown and Add Github account.
  • Once connected, select the repository you created earlier and branch.
  • Click on Next to proceed.

Setup the . NET Core application repository on Clouddley


Step 3: Connect Your Scaleway Instance
  • From the Choose or add server dropdown, select your VM if it appears in the list. If not, click + Add Virtual Machine.
  • To add your VM, enter your Scaleway Instance’s IP address as VM host, VM user, and the VM port for SSH access.
  • Once you’ve entered the details, verify the connection using the Clouddley CLI(recommended) or SSH.
  • Open your local machine’s command line, then connect to the remote VM you want to configure with Clouddley. Use this command to SSH into your Scaleway instance:
ssh root@<your-instance-ip>
  • Install Clouddley CLI by running the command:
curl -L https://raw.githubusercontent.com/clouddley/cli/main/install.sh | sh
  • To add the SSH public key, run the command:
clouddley add key
Using the CLI, you can deploy resources, manage configurations, and automate tasks efficiently.
  • Click Verify to test the connection to your VM.
  • Once it’s verified, click on Next.

Configure virtual machine on Clouddley


Step 4: Configure app settings
  • Enter the name of your app and the port your app will run on.
  • Click on Next

Configure the App name and port

Make sure your Scaleway instance’s security group allows traffic on the port your app will use.
Step 5: Add Environment Variables
  • Click on Add Variable
  • Select an ENV mode: either single variable or import variables. Learn more about Environment Variables.
  • Single Variable
  • Import Variables
Single Variable ENV mode
The URL for your.NET core application must be configured as an environment variable, either DOTNET_URLS or ASPNETCORE_URLS, in order to deploy it on Clouddley. Since the application is ASP.NET Core, we will set: key: ASPNETCORE_URLS value: http://0.0.0.0:5013
  • Add the key-value pairs and click on Save
  • Click on Next

Adding environment variables


Step 6: Setup Notifications (optional)
  • To configure the notifications settings of the application, click on Add Alert
  • Select the Alert Type. For this guide, we will use Email.
  • Toggle on the deployment events you want to be notified of, such as failed, timed out, or success.
  • Enter your email address (or multiple, if needed) and click on Save.
  • Click on Deploy

Notifications set up and creation of NestJS application on Clouddley


Step 7: Test the app
  • Click on Go to Dashboard. Your app will be visible on the apps dashboard.
  • Once deployment completes, its status will update from Deploying to Online.

.NET Core application dashboard overview

  • To test your app, click on the 🌐 Website button in the top right corner to open your live app in the browser. You should see the message “Welcome to ASP.NET Core!” displayed in your browser.

.NET Core application running from Clouddley on a Scaleway Instance

Next Steps: Managing Your App After Deployment

Once your app is live, You can change your deployment settings, roll back to a previous version, scale up if traffic grows, and even pause or resume your app when needed all from the app dashboard. Everything’s designed to be simple and quick. Need to update environment variables or check your logs? That’s all built in too. You’ll also be able to connect a custom domain and keep track of your deployment history, right from the same dashboard.

Conclusion

That’s it, you’ve successfully deployed your .NET Core app on a Scaleway instance using Clouddley. We’ve covered everything from spinning up your instance to pushing your code, keeping things straightforward and efficient. This setup isn’t just about getting your app online; it’s about building a foundation for automation and scale. You can expand or build on it as your project grows. Need to deploy other apps? Clouddley has you covered there, too.

Getting started with Clouddley?

A backend infrastructure for your own compute. Run apps, databases, brokers, and AI workloads on your VMs, bare metal, or VPS.

Resources

Faith Kovi

Updated on July 01, 2025