Skip to content

Starting up MasterServer and NatPunch on DigitalOcean droplet

pointcache edited this page Aug 18, 2017 · 8 revisions

If you know another way of doing it, share below.

Legend : M - master server NHT/NP - Nat hole punch DO - digital ocean

Way 1: Manually starting up

It is assumed you have a DO account, you made yourself an Ubuntu droplet, and know how to use Putty and FTP to drop files.

  1. get mono sudo apt-get install mono-complete
  2. Create directories for M and NHT in /var/
  3. Use FTP and copy the contents of each of them from the repository MasterServer/bin/, same for NHT
  4. Navigate to masterserver dir
  5. type screen to initiate new screen
  6. type mono MasterServer.exe

press enter enter, whatever

  1. press CTR+A, then C it will create a new "window" in the terminal

you can switch between windows by using CTR+A, P (previous), CTR+A, N (next)

  1. in the new window navigate to NHT directory and launch it same way

Done, both should be working. I'm no expert, but there are certainly ways to do all of this automatically with scripts so if anyone knows how to, append it below.


MY PORT IS CLOSED! If your droplet comes with some sort of a server it can block/filter the ports used by master sever. So in that case first check the ports if they are opened:

Download and install Nmap

When installing careful not to install additional crap (like Ncap), you wont need it for now. now open CMD and navigate to Nmap folder, like: cd C:\Program Files (x86)\Nmap Then you can use nmap ping command on your ports:

For master server

nmap -p 15940 yourdropletip


nmap -p 15941 -sU -P0 YOURIP

If your ports are blocked you will see this:

It will be filtered or blocked, otherwise open

** The NHP .exe port will not be shown as open by online port checkers, they all check for TCP listening processes on the port, while the NHP is UDP, thus for them its "closed" **

Master server port is 15940, NHP is 15941

So first let the both ports through firewall:

sudo ufw allow 15940/tcp sudo ufw allow 15941/tcp

Add them to IPTable

sudo iptables -I INPUT 1 -p udp --dport 15940 -j ACCEPT

sudo iptables -I INPUT 1 -p udp --dport 15941 -j ACCEPT

And refresh tables

iptables -L -n

See below linux commands


netstat -plunt shows all active listening processes on ports

ufw status shows all ports rules

ps -ef |grep mono shows all mono processes


Getting Started
Network Contract Wizard (NCW)
Network Object
Remote Procedure Calls (RPCs)
Unity Integration
Basic Network Samples
Scene Navigation
Master Server
Web Server
Netcoding Design Patterns
Clone this wiki locally
You can’t perform that action at this time.