# Site automatically exits read-only mode when enabled by 'discourse enable\_readonly'

**URL:** <https://meta.discourse.org/t/site-automatically-exits-read-only-mode-when-enabled-by-discourse-enable-readonly/296844>\
**Category:** Development\
**Tags:** read-only\
**Created:** [February 27, 2024, 5:27am UTC](https://meta.discourse.org/t/site-automatically-exits-read-only-mode-when-enabled-by-discourse-enable-readonly/296844 "2024-02-27T05:27:12Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![RhysGoodwin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rhysgoodwin/32/195363_2.png) [@RhysGoodwin](https://meta.discourse.org/u/RhysGoodwin)\
**Post date:** [February 29, 2024, 12:20am UTC](https://meta.discourse.org/t/site-automatically-exits-read-only-mode-when-enabled-by-discourse-enable-readonly/296844/10 "2024-02-29T00:20:50Z")

</div>

For completeness:

```plaintext
- name: Set read-only mode for live forum host
  ansible.builtin.shell: |
      docker exec app bash -c 'echo Discourse.enable_readonly_mode\(Discourse::USER_READONLY_MODE_KEY\) | rails c'
  register: enable_readonly_output

```

---

_[View the full topic](https://meta.discourse.org/t/site-automatically-exits-read-only-mode-when-enabled-by-discourse-enable-readonly/296844)._
