This guide explains how to set up .NET on shared hosting environments where you can't install software globally but can upload files.
#
##
1. Visit [.NET Download Page](https://dotnet.microsoft.com/download)
2. Download the appropriate SDK for your hosting platform:
- Linux x64: dotnet-sdk-8.0.xxx-linux-x64.tar.gz
- Linux ARM64: dotnet-sdk-8.0.xxx-linux-arm64.tar.gz
##
Extract the downloaded SDK
tar -xzf dotnet-sdk-8.0.xxx-linux-x64.tar.gz
This creates a folder with the SDK contents
Rename it to 'dotnet-sdk' for consistency
mv dotnet-sdk-8.0.xxx-linux-x64 dotnet-sdk
##
1. Upload the dotnet-sdk folder to your project root
2. Upload your Node.js project files
3. Your hosting directory should look like:
your-project/
├── package.json
├── index.js
├── setup.js
├── run-dotnet.js
├── dotnet-sdk/
← Your uploaded .NET SDK
│ ├── dotnet
← Main executable
│ ├── sdk/
│ ├── shared/
│ └── ...
└── node_modules/
##
If your hosting supports SSH access:
SSH into your hosting
ssh your-username@your-host.com
Navigate to your project
cd path/to/your/project
Set execute permission on dotnet binary
chmod +x dotnet-sdk/dotnet
Verify it works
./dotnet-sdk/dotnet --version
##
Install Node.js dependencies
npm install
Setup will automatically detect the local SDK
npm run setup
Start your application
npm start
#
If the automatic detection doesn't work, you can manually set environment variables:
##
export DOTNET_ROOT=/path/to/your/project/dotnet-sdk
export PATH=$DOTNET_ROOT:$PATH
##
Create a start.sh script:
#!/bin/bash
export DOTNET_ROOT="$(pwd)/dotnet-sdk"
export PATH="$DOTNET_ROOT:$PATH"
node index.js
Make it executable and run:
chmod +x start.sh
./start.sh
#
##
If you get permission denied:
chmod +x dotnet-sdk/dotnet
chmod +x dotnet-sdk/sdk/8.0.xxx/dotnet
For all files in SDK (if needed):
find dotnet-sdk -type f -name "dotnet*" -exec chmod +x {} \;
##
If you get "cannot execute binary file":
1. Check your hosting architecture: uname -m
2. Download the correct SDK version:
- x86_64 → use linux-x64
- aarch64 → use linux-arm64
##
Verify the SDK is detected:
Check if dotnet is found
which dotnet
Check version
dotnet --version
Check SDK location
dotnet --info
#
##
1. Use File Manager to upload the dotnet-sdk folder
2. Use Terminal (if available) to set permissions
3. Add environment variables in .htaccess or startup scripts
##
1. Include the dotnet-sdk folder in your git repository
2. Add a Procfile or startup command:
web: DOTNET_ROOT=./dotnet-sdk PATH=./dotnet-sdk:$PATH node index.js
##
1. Upload via SCP/SFTP: scp -r dotnet-sdk user@host:/path/to/project/
2. Set permissions via SSH
3. Update shell profile if needed
#
Your setup is working if:
1. ✅ dotnet --version returns a version number
2. ✅ npm run setup completes without errors
3. ✅ The web interface shows ".NET is available"
4. ✅ The sample Web API starts successfully
#
- .NET SDK is approximately 200-300MB
- Consider hosting limits on file uploads
- Some hosting providers have file count limits
- ZIP the SDK for faster upload, then extract on server
#
- The uploaded .NET SDK contains your application runtime
- Ensure proper file permissions (don't make everything executable)
- Consider hosting provider security policies
- Monitor resource usage (CPU/Memory) limits
---
Need help? Check the main README.md for additional troubleshooting steps!