You can run a server on your own computer for free, or rent one from a Minecraft host. Running it yourself is great for playing with friends; for a public server that should be online all the time, a host is usually the better choice.
Most public servers run Java Edition, because it has a large plugin ecosystem. If your friends play on phones or consoles, you can still use Java and add Geyser so Bedrock players can join too. See Java vs Bedrock servers for the details.
java -version in a terminal.java -Xms2G -Xmx2G -jar server.jar noguieula.txt.eula.txt, change eula=false to eula=true and start the server again. It now builds the world.localhost.As a rough guide: 2 GB for a few friends on vanilla or Paper, 4–6 GB for 10–30 players with plugins, and 6–10 GB or more for modpacks. More RAM than needed doesn't make a server faster; a fast CPU matters more.
Players on the same Wi-Fi can use your computer's local IP. For players elsewhere, open (forward) TCP port 25565 on your router to your computer, then give them your public IP address. Be aware that sharing your home IP tells people roughly where you are. Tunnelling services and hosts avoid this. Check that it works from outside with our server status checker.
server.properties: motd (the text under your server name; make a colourful one with our MOTD generator), max-players, difficulty, white-list for a private server.op YourName in the console.Mojang offers the Bedrock Dedicated Server for Windows and Linux on minecraft.net. It uses UDP port 19132. It has no plugin system like Paper, which is why many owners prefer a Java server with Geyser.
Once your server is stable, add it to CraftRank for free and read how to get players for your server.