No you don't have to publish your course in order to allow your students to enrol. Please see this blog post about What does Publish a course mean?
Got it!
You have helped me a lot with this. My site and courses are now working!
Thanks galore!
In reply to Mary Cooch
How to share my course with the users I have enrolled in my moodle, help please
by Rishabh Shukla -
Hi ,
How should I share the course with my team members to whom I have enrolled in my moodle. Please help, I am a new user.
In reply to Rishabh Shukla
Re: How to share my course with the users I have enrolled in my moodle, help please
by Mary Cooch -
Rishabh - please read the documentation Admin quick guide and Teacher quick guide as they explain the difference between allowing users into your site (="authentication") and allowing users into a course (= "enrolment")