from web site
The requirements above are adequate for the 1-4 players. If you are interested in creating your own dedicated server This article is for you on Minecraft Wiki.
After meeting the requirements, follow this step-by-step procedure to create the server:
#1 - Download the server.jar file
Download the server.jar file from Minecraft's official site. Players can find the server.jar file with the most current version on the site. After downloading, make sure the file name is minecraft_server.1.XX.X.jar, where XX.X is the version.
Create a folder titled "Minecraft Server" to store server-related files.
#2 - Open command prompt
Then, you can open the command prompt. Look for the command prompt on the start menu. To confirm that Java is installed, type "java-version".
Change your directory to the "Minecraft Server" folder, which contains the jar file. Copy the address from the file manager and then enter "cd" to paste the folder address. Hit Enter to change the directory to your server's folder.
For example, cdC:\Users\Admin\Desktop\Minecraft Server
After changing the directory After changing the directory, type Java -jar "name of your jar".jar" in the command prompt and hit enter. While it will show an error, there is no reason to be concerned.
Read: the top 5 Minecraft Java Edition servers in 2021
#3 - Make modifications in Eula.txt and note query.port settings
After running the jar, a new text file named Eula will be created in the server folder. Open it using a text editor and change the value from eula=false to Eula=true.
A second file, known as "server.properties" is found by players. It contains all the required information and settings like query.port and gamemode.
#4 - The server is ready to start
Enter the jar launch command again. The server will now begin without errors. Minecraft gamemodes can join the server by entering localhost or your IP address into the IP address box. You can add ":25565" to the end of your public address to join the server.
Only share your IP address with trusted family members and friends. It poses a security risk to your family and home when you share it with strangers. If you're interested, you can find out more about how to set up a server clicking here.