Host a BeamMP server on a raspberry pi 4

This is a tutorial on how to host a BeamMP server on a raspberry pi 4.

You will need a 64-bit operating system installed on your raspberry pi for this so I recommend using the 64-bit raspbian OS: Index of /raspios_arm64/images/raspios_arm64-2021-11-08

How to install a operating system on a raspberry pi: How to Install an Operating System on a Raspberry Pi

Automatic installation:

Run the file in the folder you would like your BeamMP server installed to.
Download: Dropbox - makeserver.sh - Simplify your life

Manual Installation:

Install dependencies

  • sudo apt-get update -y
  • sudo apt-get -y install git
  • sudo apt -y install cmake g++ make
  • sudo apt-get install -y libcurl4-openssl-dev
  • sudo apt-get install -y liblua5.3-dev
  • sudo apt-get install -y libz-dev
  • sudo apt-get install -y rapidjson-dev
  • sudo apt-get install -y libssl-dev
  • sudo apt-get install -y libboost-all-dev

Download the source files

  • git clone --recurse-submodules https://github.com/BeamMP/BeamMP-Server

Go into the server directory

  • cd BeamMP-Server

Checkout the branch you are wanting to use

  1. Go to Tags · BeamMP/BeamMP-Server · GitHub
  2. Find the latest version/the version you are wanting to use.
  3. Run: git checkout tags/v[Version you want to use]
  4. Example for last step: git checkout tags/v2.3.3

Build the server

  • cmake .
  • make

Create a file to start the server

  1. Ensure you are in the correct directory: cd BeamMP-Server
  2. Create the file: echo “./BeamMP-Server” > start.sh

Done! Run the start.sh file whenever you want to start the server!

1 Like

Hello jack, I am really interested in making my own server on a Raspberry. I have some questions about what you have wrote before, could you help me please ?

Sure, what are your questions?

I specify that I am very very beginner and that I don’t know a lot of things yet, my question may seem a bit stupid, but where can I modify the parameters of my server?

and also, when you say : " Run the file in the folder you would like your BeamMP server installed to.
Download: [Dropbox - makeserver.sh - Simplify your life ]" where do you recommend to run and download the file ?

You can modify the parameters of the server in the config file that will either be generated when the server is created or ran. I ran it in the desktop folder but any basic folder like desktop or downloads would work.

I currently have a Beammp server (hosted on my computer) where I have added plugins and others options I want to keep, how do I specifically set my folder on the raspberry. By saying that, I mean how do I tell to my raspberry that he hast to host this particular folder ?

I recommend that you move the plug-ins and configs over to the folder created by the makeserver.sh executable instead of moving the server to a different folder. It has been a while since I created this so I’m not entirely sure how all this works anymore.

Thank you for your responses, this helps me a lot, I am not sure if I will buy a raspberry because it’s a bit expensive and I am scared of not being able to host the server on the raspberry(because as I said I have very limited knowledge about this). In that case the raspberry would be completely useless for me. Thank you very much for the time you gave me man !

I’m happy to help! And yeah, pi’s prices are insane right now. Hope I helped and thanks for reaching out!

Hello ! Tanks for information on this topic :slight_smile:
Can we also do this with a raspberry of a previous generation? For exemple Pi 2 ?
Can we have lags with it ?

I assume you would be able to on a previous gen pi as BeamMP servers are very lightweight. This depends on a lot tho light libraries might be different on older ones or a 64 bit os might not work as well on older versions.

Hi. i am trying to get this to work om my pi 3b +. but it freezes on tha make code. at around 50%

I’m not entirely sure if this works on a pi 3b+ or if this works at all anymore. You might be running out of memory or something like that.

memory tops out at around 800-850 mb still got a bit left.
Uten navn
i get this. and then it freezes

Wait on it, or try make -j 1 or make instead of make -j, these will be slower but will most likely complete the build.

Hey just wondering what the performance of running the server on the Pi was like?

when running the make command i get this error im not sure on what it means or how to fix it can somebody help

In file included from /home/pi/BeamMP-Server/BeamMP-Server/include/Common.h:35,
from /home/pi/BeamMP-Server/BeamMP-Server/test/test_main.cpp:4:
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:51:14: error: expected identifier before ‘!’ token
requires(!std::same_as<OT, Error> && !std::same_as<OT, E> && !std::same_as<OT, T>)
^
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:51:14: error: expected ‘,’ or ‘…’ before ‘!’ token
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:52:9: error: expected constructor, destructor, or type conversion before ‘GenericResult’
GenericResult(const OT& value) {
^~~~~~~~~~~~~
In file included from /home/pi/BeamMP-Server/BeamMP-Server/include/Common.h:35,
from /home/pi/BeamMP-Server/BeamMP-Server/test/test_main.cpp:4:
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:85:14: error: expected identifier before ‘!’ token
requires(!std::same_as<E, OE>) GenericResult& with_error(const OE& error_val) {
^
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:85:14: error: expected ‘,’ or ‘…’ before ‘!’ token
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:85:36: error: expected constructor, destructor, or type conversion before ‘GenericResult’
requires(!std::same_as<E, OE>) GenericResult& with_error(const OE& error_val) {
^~~~~~~~~~~~~
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:90:14: error: expected identifier before ‘!’ token
requires(!std::same_as<T, OT>) GenericResult& with_value(const OT& value) {
^
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:90:14: error: expected ‘,’ or ‘…’ before ‘!’ token
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:90:36: error: expected constructor, destructor, or type conversion before ‘GenericResult’
requires(!std::same_as<T, OT>) GenericResult& with_value(const OT& value) {
^~~~~~~~~~~~~
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:99:14: error: expected identifier before ‘!’ token
requires(!std::same_as<E, OE>) static GenericResult Error(const OE& error) {
^
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:99:14: error: expected ‘,’ or ‘…’ before ‘!’ token
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:99:36: error: expected constructor, destructor, or type conversion before ‘static’
requires(!std::same_as<E, OE>) static GenericResult Error(const OE& error) {
^~~~~~
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:108:14: error: expected identifier before ‘!’ token
requires(!std::same_as<E, OT>) static GenericResult Ok(const OT& value) {
^
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:108:14: error: expected ‘,’ or ‘…’ before ‘!’ token
/home/pi/BeamMP-Server/BeamMP-Server/deps/lk-result/include/lk/Result.h:108:36: error: expected constructor, destructor, or type conversion before ‘static’
requires(!std::same_as<E, OT>) static GenericResult Ok(const OT& value) {
^~~~~~
make[2]: *** [CMakeFiles/BeamMP-Server-tests.dir/build.make:63: CMakeFiles/BeamMP-Server-tests.dir/test/test_main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:251: CMakeFiles/BeamMP-Server-tests.dir/all] Error 2

addition when compileing i get these errors frequently

/home/pi/BeamMP-Server/BeamMP-Server/deps/commandline/commandline.cpp: In member function ‘void Commandline::update_current_buffer_view()’:
/home/pi/BeamMP-Server/BeamMP-Server/deps/commandline/commandline.cpp:147:12: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘std::__cxx11::basic_string::size_type’ {aka ‘unsigned int’} [-Wformat=]
printf(“\x1b[2K\x1b[0G%s%s\x1b[%luG”, m_prompt.c_str(), m_current_buffer.c_str(), m_prompt.size() + m_cursor_pos + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/BeamMP-Server/BeamMP-Server/deps/commandline/commandline.cpp: In member function ‘void Commandline::io_thread_main()’:
/home/pi/BeamMP-Server/BeamMP-Server/deps/commandline/commandline.cpp:419:20: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘std::__cxx11::basic_string::size_type’ {aka ‘unsigned int’} [-Wformat=]
printf(“\x1b[2K\x1b[0G%s\n%s%s\x1b[%luG”, to_write.c_str(), m_prompt.c_str(), m_current_buffer.c_str(), m_prompt.size() + m_cursor_pos + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~