These requirements are enough for the 1-4 players. If you're looking to create a dedicated server, check out this article on Minecraft Wiki.
Once you have met the requirements, follow this step by procedure to set up servers.
#1 - Download the server.jar
Download the server.jar file from Minecraft's official website. mclijst.nl can download the server.jar file for the most recent 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 named "Minecraft Server" to store the server-related files.
#2 - Open command prompt
The next step is to open the command prompt. Search for the command prompt on the start menu. Type "java-version" to verify whether java is installed or not.
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 address of the folder. Hit Enter to change the directory to your server folder.
For example, cdC:\Users\Admin\Desktop\Minecraft Server
After changing the directory, enter Java --jar "name your jar".jar in the command prompt. Press Enter. It will show an error however there's no reason to be concerned about it.
Read the Top 5 Minecraft Java Edition Servers in 2021
#3 - Changes to Eula.txt, and note query.port settings
After running the jar, an additional text file named Eula will be added to the server folder. Open it using text editor and alter the eula=false value to eula=true.
A second file, known as "server.properties" can be located by players. It contains all the necessary information and settings such as query.port and gamemode.
#4 - The server is set to go live
Then, type the command jar launch again. The server will now start without any errors. You can join the server by typing localhost or public IP address in the IP address box. Others can join the server by adding ":25565" at the end of your public IP address.
Just share your public IP address with trusted family members and friends. Don't share it with strangers as it could cause a security threat to your family and home. Click here to find out more about the process of setting up an Server.