Installing custom certificates on your instance
The following instructions assume the API Self-hosted appliance is running and was launched using Docker Compose. However, the instructions can be adapted for most orchestration systems. An example Docker Compose configuration is published on GitHub to the official Draftable API Self-hosted repository.Prerequisites
The following files should be configured and ready before the installation procedure begins.- Custom certificate files which include a .crt and .key files respectively
- An instance that has already gone through the first time configuration
- An instance that has been configured using docker-compose (you cannot install custom certificates using docker run based instances)
Installation procedure
The custom.crt and custom.key files refer to the custom TLS certificate and private-key respectively. The file names are not important, but it’s recommended to use the .crt and .key file extensions. If using different file names you should reflect this is the below instructions as appropriate.Note: Ensure you have versed yourself and are using docker compose for container start-up before you start this custom certificate installation process.
- Determine the name of the running API Self-hosted container. Use command below:
- Create the directory where the custom TLS certificate will be stored. Use command template below, remembering to change the <container_id> field to the name of your instance:
- Copy the custom TLS certificate and private-key to the container. Use command template below, remembering to change the <container_id>, custom.crt and custom.key fields to the name of your instance, generated certificate and key names respectively:
- Set the appropriate permissions on newly created directories and files. Use command template below, remembering to change the <container_id>, custom.crt and custom.key fields to the name of your instance, generated certificate and key names respectively:
- Update your docker-compose.yml file with the following configuration: (Note if you are not using docker compose to run your containers, please see the attached documentation to how to setup and run your containers via docker compose)
Note: That the above snippet should be merged with the existing content of your Docker Compose file (or equivalent YAML configuration for your orchestration system). Attached to this article is an example of a docker compose.yml file. Click here for more information regarding the docker-compose.yml file.
- For the changes to take effect, restart the container by using the docker compose down and up commands. Ensure you are currently in the directory where the docker compose YAML exists:
- Once the container has stopped, we run the up command