You can enable self-enrollment with a secret URL in your course Settings.
Click the Settings link.
Click the More Options link.
Click the Let students self-enroll by sharing with them a secret URL or code checkbox [1].
If you want to add a enrollment link to the course home page, click the Add a "Join this Course" link to the course home page checkbox [2].
Click the Update Course Details button.