Valheim does not support turning off raids. To turn off a raid you will need to use a modded version of the game.
The mod that you should install is NoRaid - it's available through Thunderstore and can be found here: https://thunderstore.io/c/valheim/p/MystroDev/NoRaid/
With ServerFlex, installing mods on your Valheim server is easy. In two clicks you'll be all setup.

- Head over to your Valheim server and select the Mods tab on the horizontal navigation.
- In the search box, type NoRaid.
- On the NoRaid item click Install Latest
- Click accept again on the pop up
- Wait for the mod to install
- Restart your server.
It's that simple! There will be no more raids on your server.