# Creating a server key pair and certificate

Follow these steps to create a server key pair and a server certificate.

1. On the server system, issue the following command to to create a server key pair in a key store guarded by the `secretServerPassword` password:

       keytool -genkey -alias MyServerName -keystore ~/vault/ServerKeyStore
       Enter keystore password: secretServerPassword
       ...

2. Issue the following command (all on one line) to create a certificate named `ServerCertificate` from this key:

       keytool -export -alias MyServerName \
       -keystore ~/vault/ServerKeyStore -rfc -file ServerCertificate \
       -storepass secretServerPassword

Parent topic: Configuring SSL/TLS
Related concepts
Booting the server and connecting to it
Key and certificate handling
Starting the server with SSL/TLS
Running the client with SSL/TLS
Other server commands
Related tasks
Creating a client key pair and certificate
Importing certificates