### Server node with encryption enabled

The following example shows a server node configured with encryption enabled.
Refer to the [Security](/consul/docs/secure) chapter for additional information about how to configure security options for Consul.

<CodeTabs>

```hcl
node_name = "consul-server"
server = true
ui_config {
  enabled = true
}
data_dir = "consul/data"
addresses {
  http = "0.0.0.0"
}
retry_join = [
  "consul-server2",
  "consul-server3"
]
encrypt = "aPuGh+5UDskRAbkLaXRzFoSOcSM+5vAK+NEYOWHJH7w="

tls {
  defaults {
    verify_incoming = true
    verify_outgoing = true
    ca_file = "/consul/config/certs/consul-agent-ca.pem"
    cert_file = "/consul/config/certs/dc1-server-consul-0.pem"
    key_file = "/consul/config/certs/dc1-server-consul-0-key.pem"
    verify_server_hostname = true
  }
}

```


```json
{
  "node_name": "consul-server",
  "server": true,
  "ui_config": {
    "enabled": true
  },
  "data_dir": "consul/data",
  "addresses": {
    "http": "0.0.0.0"
  },
  "retry_join": ["consul-server1", "consul-server2"],
  "encrypt": "aPuGh+5UDskRAbkLaXRzFoSOcSM+5vAK+NEYOWHJH7w=",
  "tls": {
    "defaults": {
      "verify_incoming": true,
      "verify_outgoing": true,
      "ca_file": "/consul/config/certs/consul-agent-ca.pem",
      "cert_file": "/consul/config/certs/dc1-server-consul-0.pem",
      "key_file": "/consul/config/certs/dc1-server-consul-0-key.pem"
    },
    "internal_rpc": {
      "verify_server_hostname": true
    }
  }
}
```

</CodeTabs>