It entirely depends on the version you’re going to be playing. 1GB RAM will be enough if you’re playing Vanilla / Java by yourself or a few friends. Forge for example, requires at least 2GB of RAM. If you’ll be installing other RAM & CPU intensive mods such as SkyFactory, Realistic Textures, rlcraft, we’d recommend at least 4GB RAM. Add 500mb extra RAM for every additional player on the server.
If there are going to be 10-20 people online simultaneously, we recommend at least 4GB of RAM. Remember every extra player and each MOD you install will require additional RAM.
If you get errors similar to following, it means your server is running out of resources and adding extra RAM is highly recommended:
"There is insufficient memory for the Java Runtime Environment to continue".
Another factor that might introduce some lag and require additional resources is how you and your friends play the game.
If you’re going to have thousands of TNTs exploding for example, you must have sufficient RAM and CPU for the load.