To set your Moodle Site in Maintenance Mode:
1. Go to Site Administration > Server > Maintenance Mode.
2. On the field Maintenance Mode, select Enable. You can add optional maintenance message which your users will see upon accessing the site.
3. Save Changes

To disable, follow the same steps above and choose Disable.