If you already have your SSL Certificate and just need to install it, see
SSL Certificate Installation :: Courier IMAP Server.
How to generate a CSR for your Courier POP/IMAP server
Of course if you prefer to build your own shell commands, just follow our generic instructions for OpenSSL CSR creation.