Using user-defined ports

You can install and run Couchbase Server with user-defined ports rather than with the default ports.

To run Couchbase server on user-defined ports, make sure that the minimum RAM and CPU are available for the Couchbase instance.

Note: Before creating user-defined ports, refer to the list of the reserved network ports.

Setting up Couchbase Server with user-defined ports

  1. Install Couchbase Server
    • If Couchbase Server is already installed and running, stop it.
  2. Add the new user-defined ports to the /opt/couchbase/etc/couchbase/static_config file.
    • The /opt/couchbase/etc/couchbase/static_config is the location from where the Couchbase Server picks up the configuration parameters.
    • If port numbers are not specified, default ports are used.
    • To override some or all default ports, append the user-defined ports to the file.
  3. (Optional) CAPI port (default 8092) can be edited in the /opt/couchbase/etc/couchdb/default.d/capi.ini file by replacing 8092 with the new port name.
  4. If the Couchbase Server was previously configured, delete the opt/couchbase/var/lib/couchbase/config/config.dat file to remove the old configuration.
  5. Start Couchbase Server.

Ports to change

The following are the user-defined ports to add, replace, or append to the /opt/couchbase/etc/couchbase/static_config file.


{rest_port, 9000}.                                   
{mccouch_port, 8999}.                         
{memcached_port, 12000}.
{memcached_dedicated_port, 11999}.
{moxi_port, 12001}.
{short_name, "ns_1"}.
{ssl_rest_port,11000}.                       
{ssl_capi_port,11001}.
{ssl_proxy_downstream_port,11002}.
{ssl_proxy_upstream_port,11003}.
Note: If the newly configured ports overlap with ports used by other running applications, Couchbase Server fails to start. If the newly configured ports overlap with ports used by Couchbase buckets, Erlang crash notifications appear in the log file.
Note: In order to set up multiple nodes per machine, you need to assign unique values to these ports.

How to map user-defined ports to the default ports

This chart shows how certain user-defined ports are mapped to the default ports:

{rest_port, 9000}                    8091 Web administration port                                   
{mccouch_port, 8999}                 11213 Default value for mccouch                         
{memcached_port, 12000}              11211 Client interface (proxy)
{memcached_dedicated_port, 11999}    11211 Client interface (proxy)
{moxi_port, 12001}                   11210 Internal/external bucket port
{ssl_rest_port,11000}                18091 Internal REST HTTPS for SSL                                      
{ssl_capi_port,11001}                18092 Internal CAPI HTTPS for SSL
{ssl_proxy_downstream_port,11002}    11214 Incoming SSL proxy
{ssl_proxy_upstream_port,11003}      11215 Internal outgoing SSL proxy
Important:
All default ports are reserved and cannot be used for other purposes.