Find the server pack
On the modpack's CurseForge page, open Files, select the version that matches what your players use, and look for the server pack under additional files, often labelled Server Files or ServerPack. Download that zip, not the normal client pack.
Upload and start it
Upload the zip to an empty server and extract it. Most server packs include a startserver.sh or start script, or an installer that downloads the loader and libraries on first run. Read the pack's README; some packs want you to run an installer once before the normal start.
Accept the EULA in eula.txt and start again. The first start takes several minutes as the pack loads thousands of files.
Set the memory
Pack authors list a recommended RAM; treat it as a minimum. On NeoForge and Forge packs, memory usually goes in user_jvm_args.txt or a variables file shipped with the pack. Leave headroom between Java's maximum heap and your plan's memory.
When there is no server pack
Install the same loader version on the server, copy the mods and config folders from a client install of the pack, and remove client-only mods. A server that crashes with errors about client classes is the sign that one is still in the folder. This takes trial and error, so a pack with official server files is much easier to host.
Players and updates
Players install the same pack version through the CurseForge app. When the pack updates, update server and clients together, and back up before every pack update, as removed mods delete their blocks from the world.