Check for official server files
Some packs publish a ready server zip on their Modrinth page or GitHub. If so, use it, as the author has already removed client-only mods.
Install from the .mrpack
Otherwise, use a tool that reads the .mrpack and downloads only the server-side mods, such as the open-source mrpack-install. It installs the right loader and fetches every mod marked for the server. You can run it on your own PC and upload the result, or run it on the server where shell access is available.
Doing it by hand
A .mrpack is a zip. Inside, modrinth.index.json lists the Minecraft version, the loader and every file with its environment. Install the same loader version on the server, download each file whose server environment is required or optional, and copy the overrides folder, which holds configs, into the server root.
Keep players in sync
Players import the same .mrpack version into the Modrinth App, Prism Launcher or another launcher. Pin the version you run on the server in your Discord or server info, because Modrinth launchers update packs easily and a mismatch blocks joining.