Hosting a Server - 0x0ade/CelesteNet GitHub Wiki
Prerequisites 📓
To run the server, you will need to install the .NET 7.0 runtime on your machine.
(Optionally) To build the server, you will the .NET 7.0 SDK or newer, and the .NET runtime 7.0 on your machine.
Microsoft .NET documentation > How to install
You can always check which SDKs and Runtimes you have installed (if any):
dotnet --list-runtimes
dotnet --list-sdks
On Linux at this time it looks like
- generally, distro releases that are still supported have
dotnet-runtime-8.0anddotnet-sdk-8.0in the main repos for:- Ubuntu
- Fedora
- RHEL & CentOS Stream
- Ubuntu e.g. has
dotnet-runtime-7.0&dotnet-sdk-7.0in 22.04LTS but not in 24.04LTS anymore. Building server seems to work fine on SDK 8.0, running with runtime 8.0 hasn't been tested atm. - for Debian 12, Microsoft have a
.debwith the sources list & signing key etc. for their repos:
wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install dotnet-sdk-8.0
(Source: Install the .NET SDK [...] on Debian)
Running server Release builds 📂
⚠️ Make sure you've installed the correct .NET runtime as detailed in the Prerequisites 📓 section!
You can download the latest server build on the Releases page. Simply check the latest (top-most) entry there and scroll to the last section where it says 🔽 Assets and download the attached zip file.
Extract the server files to a suitable location.
Windows 🪟
Option A:
Navigate into the net7.0 folder and run CelesteNet.Server.exe from File Explorer, a console window should open.
Continue in section Connecting to server, or Troubleshooting if something failed.
Option B:
Open your favorite terminal program / shell (e.g. Git Bash, PowerShell, cmd.exe ...) with the current working directory inside the net7.0 folder.
(If you Shift+Right click into the folder in Explorer, not clicking any files, you should get the option "Open PowerShell window here")
Run:
dotnet ./CelesteNet.Server.dll
Continue in section Connecting to server, or Troubleshooting if something failed.
Linux 🐧
Simply go into the net7.0 folder in a terminal and run the server with dotnet like so:
cd net7.0/
dotnet ./CelesteNet.Server.dll
Continue in section Connecting to server, or Troubleshooting if something failed.
Connecting to server 🌐
Either way after a short while you should see the log output slow down around this line:
(10/21/2024 00:59:46) [CRI] [main] Ready
You should now be able to connect to your server from Celeste e.g. by toggling the CelesteNet mod option Connect to local server or running con localhost in the game's debug console. There should be logging activity on the server console output from your connection attempts.
Troubleshooting ❓
TODO 🐈⬛
Building and running from repo :octocat:
⚠️ Make sure you've installed the correct .NET SDK (not just runtime) as detailed in the Prerequisites 📓 section!
The server, just like the Client mod can be built referencing Celeste & Everest's assemblies, this used to be the only way, usually by cloning the repo in your Celeste Mods folder.
For building and running only the server, you can do the following instead:
- Create a folder
lib-strippedin the cloned repo folder. - Put FNA.dll (e.g. from your Celeste installation) into
lib-stripped. Some code like the CelesteNet.Shared module still references FNA classes. - Inside the cloned repo folder run the following:
dotnet build -c Release -t:CelesteNet_Shared:Rebuild -t:CelesteNet_Server_ChatModule:Rebuild -t:CelesteNet_Server_FrontendModule:Rebuild -t:CelesteNet_Server_SqliteModule:Rebuild -t:CelesteNet_Server:Rebuild
You can also simply run this:
dotnet build -c Release
The only difference is that msbuild will tell you that it failed to build the CelesteNet.Client project, which is fine of course.
If the Server built fine, you should be able to do the following:
cd CelesteNet.Server/bin/Release/net7.0/
dotnet ./CelesteNet.Server.dll
Refer back to Connecting to server, or Troubleshooting if something failed.