Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start redis-server on a different port than the default port 6379 in ubuntu

How to start redis-server on a different port than the default port 6379 in Ubuntu? I have used the following steps to install the redis:

sudo add-apt-repository ppa:rwky/redis sudo apt-get update sudo apt-get -y install redis-server 

I installed it, but I don't know how to start redis-server on a different port than the default port 6379. So kindly tell me the steps to change the default port to different port?

like image 896
klee Avatar asked Jan 12 '15 04:01

klee


People also ask

How do I run a Redis server on a specific port?

You can edit the Redis server configuration file and specify the startup port to make the changes permanent. Locate the entry as shown below and change the value to your desired port. Once you set your desired port, save and close the file. Next, restart the Redis service to apply the changes.

What is the default port of Redis server?

By default, the Redis server runs on TCP Port 6379.


1 Answers

redis-server --port 6380 will start a Redis server listening to port 6380.

redis-cli -p 6380 -- a suggestion made here as well -- does not start a Redis server listening to port 6380, but tries to connect the CLI to a (hopefully running) Redis server that listens to that port.

like image 110
Jochem Schulenklopper Avatar answered Oct 11 '22 19:10

Jochem Schulenklopper