To install an SSL certificate on Heroku, follow these organized steps:
Using the Heroku Dashboard:
- Access the App: Navigate to your app's dashboard in Heroku.
- Navigate to SSL Settings: Go to the "SSL Certificates" section within the app's menu.
- Upload Certificate:
- Click "Add Certificate."
- Upload
server.crtandserver.keyfiles.
- Follow Instructions: Complete any additional steps required, such as domain verification if using a third-party CA.
Using the Heroku CLI:
- Verify CLI Version: Ensure your Heroku CLI is updated with
heroku update. - List Apps: Use
heroku apps:listto identify your app name. - Add Certificates:
- Run
heroku certs:add server.crt server.key --app yourappname.
- Run
- Verify Installation: Check with
heroku certs:infoto confirm the SSL configuration.
Managing and Updating Certificates:
- Removal: Go to SSL settings, click the gear icon next to the certificate, then select "Remove" and confirm by entering the app name.
- Update: Similar to adding, navigate to SSL settings, click the gear, and choose "Update Certificate," following the same steps as addition.
Additional Considerations:
- Security: Handle private keys securely; avoid accidental removal.
- Renewal: Plan ahead to update certificates before expiration, especially for self-signed or third-party issued ones.
- No Downtime: Heroku typically handles updates without service interruption.
