Because read-only is often a too strong measure to temporarily close down a forum for new posts this plugin has been made.
An alternative is to edit all security settings of all categories, but that can be time consuming and prone to errors.
To install Discourse Plugin - https://meta.discourse.org/t/install-a-plugin/19157
Go to Admin - Plugins - discourse-prevent-posting - Settings
prevent posting enabled
: enable the plugin and prevent new posts from being made.
prevent posting message
: message to show as global notice when the plugin is enabled.
prevent posting allow pms
: if enabled, PM's are allowed.