Currently, higher education institutes are urged to adapt their education programmes rapidly to online courses. This toolbox article provides recommendations for optimising collaborative learning in online courses from the perspective of course design, and the roles of teachers and students, all illustrated in our example. With regards to course design, it is recommended to construct learning tasks for which students need to collaborate to reach a shared goal, use collaboration scripts to structure activities and communication, manage expectations about collaboration, provide room for discussion about the team process, facilitate autonomy and use existing communication tools. The presence of teachers online is essential, to provide feedback on the content and to guide team processes. Finally, students are recommended to get to know fellow students, to create a positive atmosphere and to reflect on the collaboration. We conclude that online collaborative learning can work well, but requires a balance between course structure and autonomy, and needs active monitoring during implementation. If this is done, it is perfectly possible to engage students and teachers, to support deep learning and to develop collaboration skills.