Minecraft Servers RAM (memory) needs vary, every server software is different and memory requirements can be much greater depending on the software you're using. Here's a few basic examples to base your needs off of.
Vanilla Server
The vanilla server software provided by Mojang has low memory requirements, so 1GB RAM should be able to support around 4 to 6 players. For every extra GB of RAM, you can around double or triple the expected player limit. Example, 4GB RAM on Vanilla should be OK with around 30 players. The only downside is vanilla has no plugin or mod support.
Keep in mind that every world is different as well, some worlds that have many things happening in it will also require more RAM (memory). Things such as mob grinders, automated farms, or things that require higher physics resources like water/explosion.
Spigot, Paper, etc
Spigot and development forks of Spigot, such as PaperMC have higher base memory requirements and generally use around 1.3 to 1.8 GB of RAM for a new server running idle with no players. So, if you expect to have more than 10 players online, it's highly recommended to use at least 3GB RAM.
The benefit of Spigot and Paper is that they support Spigot plugins, plugins can add many convenient features to your server, like mcMMO, RPG Plugins, Dynmap, rollback plugins and more.
Forge, Fabric Mod Packs
Mod packs require much more RAM than anything else, with most popular mod pack authors recommending at least 4GB to 6GB RAM for the mod packs to run well. For a personal server with a few friends, 4GB or 5GB RAM will be fine in most cases. If you expect to have 15+ players online a modded server we recommend at least 8GB RAM.
Most Popular Articles
"Failed to start Minecraft server" getLogger error
If you're getting errors when starting your Minecraft server, mainly KCauldron, and have the...
Minecraft "java.security.AccessControlException: access denied"
Some plugins (Such as ExecuteEverywhere) sometimes can require specific java security policies to...
Fix "c.s.w.b.WorldEditListener (PlayerInteractEvent)" Timings Lag
If you're running a Spigot server with WorldEdit, WorldGuard and GroupManager plugins together,...
Minecraft client connection delay / lag
Some people have issues with a three to six second connection delay in the vanilla Minecraft...
Minecraft Server Plugin - Establishing SSL connection without server's identity verification is not recommended.
Some servers may run versions of MySQL that have different SSL requirements/settings, without SSL...