# Compile server code?

**URL:** <https://forum.heroiclabs.com/t/compile-server-code/1190>\
**Category:** Game Design\
**Tags:** getting-started\
**Created:** [December 1, 2020, 8:59pm UTC](https://forum.heroiclabs.com/t/compile-server-code/1190 "2020-12-01T20:59:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hgouveia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/hgouveia/32/410_2.png) [@hgouveia](https://forum.heroiclabs.com/u/hgouveia)\
**Post date:** [December 1, 2020, 8:59pm UTC](https://forum.heroiclabs.com/t/compile-server-code/1190/1 "2020-12-01T20:59:46Z")

</div>

Hello,

I want to start a multiplayer project, but with the idea that users could host their own dedicated server, so basically they will need to mount their own nakama server with my server logic code, i was thinking to do the logic with Lua, but this means the user could change the logic since is not compiled, i was wondering if is there any way to compile the code and just distributed as binary , probably using Go instead?

any suggestions? or if is not possible at all

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [December 1, 2020, 10:29pm UTC](https://forum.heroiclabs.com/t/compile-server-code/1190/2 "2020-12-01T22:29:34Z")

</div>

@hgouveia Welcome 👋

Sure, the server already supports code written in Go as a server language. Have a look at this README on how to do it.

[https://github.com/heroiclabs/nakama/tree/master/sample\_go\_module](https://github.com/heroiclabs/nakama/tree/master/sample_go_module)

Also have a look at this GitHub Gist which covers a Docker workflow that makes local development a little easier for game teams who are familiar with Docker:

[https://gist.github.com/novabyte/cc6d57022e2d3baa40e98d8fc91dc4c8](https://gist.github.com/novabyte/cc6d57022e2d3baa40e98d8fc91dc4c8)

The approach that is recommended for server development does not require the server itself to be rebuilt but instead you would write your custom game logic and compile it to a “plugin” (a shared object) which is loaded by the game server at startup.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![hgouveia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/hgouveia/32/410_2.png) [@hgouveia](https://forum.heroiclabs.com/u/hgouveia)\
**Post date:** [December 2, 2020, 7:11am UTC](https://forum.heroiclabs.com/t/compile-server-code/1190/3 "2020-12-02T07:11:58Z")

</div>

thanks, @novabyte this is really great and great samples!

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [December 2, 2020, 10:01am UTC](https://forum.heroiclabs.com/t/compile-server-code/1190/4 "2020-12-02T10:01:43Z")

</div>

@hgouveia We also have a full project template for the layout of server logic with the game server which is still a work in progress so we’ve not open-sourced it but would be useful to your project I think. I’ve attached it to this thread as a download (renamed the file extension so the upload is allowed). Hope it helps.

[nakama-project-template.zip.txt](https://forum.heroiclabs.com/uploads/short-url/AizZfau84ROBJLHgaGiqStSCp9Y.txt) (30.6 KB)
