# How to run Discourse in production mode locally?

**URL:** <https://meta.discourse.org/t/how-to-run-discourse-in-production-mode-locally/87198>\
**Category:** Development\
**Created:** [5월 10, 2018, 7:19오후 UTC](https://meta.discourse.org/t/how-to-run-discourse-in-production-mode-locally/87198 "2018-05-10T19:19:54Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![eatcodetravel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eatcodetravel/32/94385_2.png) [@eatcodetravel](https://meta.discourse.org/u/eatcodetravel)\
**Post date:** [5월 10, 2018, 7:19오후 UTC](https://meta.discourse.org/t/how-to-run-discourse-in-production-mode-locally/87198/1 "2018-05-10T19:19:54Z")

</div>

I’m trying to debug a plugin that works locally but doesn’t in production. I want to run Discourse locally in production but I’m having some issues and I don’t want to keep digging if this is not the right way.

What I’m doing right now that works is

1. Copy database configuration for development to production in the `config/database.yml` file
2. Remove the `database_configuration` method override in `application.rb`
3. Remove the check for puma configuration to be used in production in `config/puma.rb`
4. Set `config.public_file_server.enabled = true` in `config/environments/production.rb`
5. Compile assets with `env RAILS_ENV=production bundle exec rake assets:precompile`
6. Run the server with `env RAILS_ENV=production bundle exec rails s`

Is there an easier way to do this?

Thanks!

---

_[View the full topic](https://meta.discourse.org/t/how-to-run-discourse-in-production-mode-locally/87198)._
