# How do I open the Rails console in Discourse Docker in production mode?

**URL:** <https://meta.discourse.org/t/how-do-i-open-the-rails-console-in-discourse-docker-in-production-mode/16970>\
**Category:** Self-hosting\
**Tags:** hosting\
**Created:** [28.Июнь.2014 21:37:25 UTC](https://meta.discourse.org/t/how-do-i-open-the-rails-console-in-discourse-docker-in-production-mode/16970 "2014-06-28T21:37:25Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)\
**Post date:** [30.Январь.2019 08:23:45 UTC](https://meta.discourse.org/t/how-do-i-open-the-rails-console-in-discourse-docker-in-production-mode/16970/7 "2019-01-30T08:23:45Z")

</div>

I added the bellow in app. yml, but it fails, how can I run rails c with out interacting I need to run it once. (I am using ansible to automate installation)

```
run:
  - exec: echo "Beginning of custom commands"
  # If you want to set the 'From' email address for your first registration, uncomment and change:
  # After getting the first signup email, re-comment the line. It only needs to run once.
  - exec: rails r "u = User.create!(username: '{{ discourse_developer_username }}', email: '{{ discourse_developer_emails }}', password: '{{ discourse_developer_password }}', admin: true)"

```

---

_[View the full topic](https://meta.discourse.org/t/how-do-i-open-the-rails-console-in-discourse-docker-in-production-mode/16970)._
