Configure Momento Proxy for your environment
Getting started with Momento Proxy is fast and straightforward. You can run it using Docker with only a Momento API key and a configuration file.
Prerequisites
- A valid Momento API key.
- At least one cache created in your Momento account.
Running with Docker
You can pull and run the Momento Proxy container from Docker Hub:
docker pull gomomento/momento-proxy
docker run -d \
-p 11211:11211 \
-p 6379:6379 \
-p 9999:9999 \
-e MOMENTO_AUTHENTICATION=<YOUR_MOMENTO_API_KEY> \
gomomento/momento-proxy
This starts the proxy with a default configuration file.
To use a custom config, configure the CONFIG
environment variable and the directory where your config file is located:
docker run -d \
-p 11211:11211 \
-p 6379:6379 \
-p 9999:9999 \
-e MOMENTO_AUTHENTICATION=<YOUR_MOMENTO_API_KEY> \
-e CONFIG=my_custom_config.toml \
-v /your/path/to/config:/app/config \
gomomento/momento-proxy
Ports:
11211
for Memcached protocol6379
for Redis protocol9999
for admin/stats commands
Verifying the proxy is working
Once the proxy is running, you can verify connectivity and functionality by testing the Memcached interface. Successful responses confirm that your application can communicate with Momento through the proxy.
Memcached protocol (via telnet)
Use telnet to test Memcached behavior:
telnet localhost 11211
set foo 0 0 3
bar
get foo
You should see responses like:
STORED
VALUE foo 0 3
bar
END
This confirms that your set and get operations are being processed by Momento through the proxy. You should see successful responses from Momento now! Ready to configure your application code? Learn how to run the proxy as a sidecar.