These links will help you
Beginners Guide to Install Discourse on macOS for Development
Beginners Guide to Install Discourse on Ubuntu for Development
HOWTO Set up a development environment using vagrant (Ubuntu guide)