You can apply for the visa not earlier than six months before the course start date indicated on the CAS.