# Online networking games for STK ## Hosting server ### Hosting WAN (public internet) server You are required to have an stk online account first, go [here](https://addons.supertuxkart.net/register.php) for registration. It is recommended you have a saved user in your computer to allow hosting multiple servers simultaneously with the same account, if you have a fresh STK installation, first run: `supertuxkart --init-user --login=your_registered_name --password=your_password` After that you should see `Done saving user, leaving` in terminal if it successfully logged in. Than you can just run: `supertuxkart --server-config=your_config.xml --network-console` It will create that xml configuration file if not found in current directory, you can type `quit` in terminal, than you can edit that file for further configuration as required. The current server configuration xml looks like this: ```xml ``` At the moment STK has a list of STUN servers for NAT penetration which allows players or servers behind a firewall or router to make connectable to each other, but in case it doesn't work, you have to manually disable firewall / do a port-forward for the server port STK using. By default STK uses `2759` for server port, for example in Ubuntu alike Linux distribution do the following to disable firewall on such port: `sudo ufw allow 2759` You may also need to handle the server discovery port `2757` for connecting your WAN server in LAN / localhost. Notice: You don't need to make any firewall or router configuration if you connect to our official servers. ### Hosting LAN (local internet) server Everything is basically the same as WAN one, except you don't need an stk online account, just do: `supertuxkart --server-config=your_config.xml --lan-server=your_server_name --network-console` In LAN network it is required that the server and server discovery port is connectable by clients directly, no NAT penetration will be done in LAN. ------ After the first time configuration, you can just start the server with the command: `supertuxkart --server-config=your_config.xml`, regardless of whether LAN or WAN server is chosen (of course you need to have a saved user for the WAN one), by default your server logging will be saved to the STK configuration directory with a name of `your_config.log`, given that the server configuration filename is `your_config.xml`. You can find out that directory location [here (See Where is the configuration stored?)](https://supertuxkart.net/FAQ)