# generate private key
openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048
# public (based on private key)
openssl rsa -pubout -in private_key.pem -out public_key.pem
Convert to base64 to be used in env variables
# private
base64 -i private_key.pem -o private_key-base64.txt
# public
base64 -i public_key.pem -o public_key-base64.txt