find server files
https://www.minecraft.net/en-us/download/server/bedrock
example
wget "https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-1.21.124.2.zip"
you need to change it for every minecraft upadate so you would need to save world daatt and things.
to start server run this command
./bedrock_server
use playit.gg
https://playit.gg/download/linux
to get a valid ip address