create subdomain in dns and route the traffic to to moodle server. change the config file(config.php) in moodle folder. replace localhost with your domain.
My two bit.
1) Obtain a static IP from your ISP (Internet Service Provider). You can also get a dynamic IP from a service like noip.com, but I will not recommend it.
2) Create the DNS and map it to your IP.
3) You will have to create an Apache Server to respond to your domain name.
4) Update config.php
I strongly recommend that you get a good SMTP service to work with your email on your production environment.
You are good to go.
All the best.