Valkey VPS - Getting Started Guide

Valkey VPS - Getting Started Guide

Your Valkey VPS based on Ubuntu 24.04 comes fully configured - Valkey is installed with the password you specified during order. Valkey is an open-source, high-performance in-memory data store (BSD license) - a fork of Redis compatible with all Redis clients and libraries.

Software Included

Component Version
Ubuntu24.04 LTS
Valkey7.2 (Ubuntu repo)
Fail2Banlatest

Step 1 - Get Your Server Credentials

Log in to your client panel and open your VPS service details. You will need:

  • IP address of your server
  • Root password (for SSH access)

The Valkey password is the one you entered during the order.


Step 2 - Connect via CLI

SSH into your server and use valkey-cli to interact with Valkey:

ssh root@your.server.ip
valkey-cli -a your_password

Basic commands to verify everything works:

# Test connection
PING
# Expected: PONG

# Store and retrieve a value
SET mykey "Hello Valkey"
GET mykey

# Check server info
INFO server

Tip: When connecting via SSH for the first time, use the root password from your client panel. The Valkey password is a separate credential for the data store itself.


Step 3 - Connect from Your Application

Valkey accepts remote connections on port 6379. It is fully compatible with Redis clients - use any Redis library in your application:

Parameter Value
Hostyour.server.ip
Port6379
Passwordyour_password (from order)

Connection string format:

redis://default:your_password@your.server.ip:6379

Example - Python:

import redis
r = redis.Redis(host='your.server.ip', port=6379, password='your_password')
r.set('key', 'value')
print(r.get('key'))

Example - Node.js:

const Redis = require('ioredis');
const client = new Redis({
  host: 'your.server.ip',
  port: 6379,
  password: 'your_password'
});

Note: Port 6379 is the Valkey/Redis protocol - it cannot be opened in a browser. Use a client library or valkey-cli.


Step 4 - Connect with a GUI Tool (Optional)

You can use any Redis-compatible GUI tool to manage your Valkey server:

  • Another Redis Desktop Manager (ARDM) - free, cross-platform
  • Redis Commander - web-based, MIT license
  • Medis - macOS

Use the same connection details from Step 3 (host, port 6379, password).


What's Pre-Configured

  • Remote access: Valkey accepts connections from any IP on port 6379 (password required)
  • maxmemory: Automatically set to 75% of available RAM on first boot
  • Eviction policy: allkeys-lru - least recently used keys are removed when memory limit is reached
  • Persistence: RDB snapshots enabled by default (automatic point-in-time backups to disk)
  • System tuning: vm.overcommit_memory, somaxconn and Transparent Huge Pages optimized for Valkey
  • Security: Fail2Ban protects SSH from brute-force attacks

Common Use Cases

Caching

Use Valkey as a cache layer for your web application to reduce database load:

# Set a value with 1 hour expiration (3600 seconds)
SET page:home "<html>..." EX 3600

# Check remaining time to live
TTL page:home

Session Storage

Store user sessions in Valkey for fast access across multiple application servers:

# Store session data (hash)
HSET session:abc123 user_id 42 role admin
EXPIRE session:abc123 1800

# Retrieve session
HGETALL session:abc123

Message Queue

Use Valkey lists as a simple message queue:

# Producer: add tasks to queue
LPUSH tasks '{"type":"email","to":"user@example.com"}'

# Consumer: wait for and process tasks
BRPOP tasks 0

Post-Installation

Fail2Ban - Brute-Force Protection

Your server comes with Fail2Ban pre-configured to protect SSH from brute-force attacks.

Rule Max Attempts Ban Duration
SSH5 failed logins10 minutes

Useful commands:

# Check banned IPs
fail2ban-client status sshd

# Unban an IP
fail2ban-client set sshd unbanip 1.2.3.4

If you accidentally lock yourself out, connect via VNC console in your client panel and unban your IP.

Performance Tuning

Valkey is automatically tuned on first boot. To check current settings:

valkey-cli -a your_password INFO memory
valkey-cli -a your_password CONFIG GET maxmemory
valkey-cli -a your_password CONFIG GET maxmemory-policy

To adjust maxmemory (e.g., to 2 GB):

valkey-cli -a your_password CONFIG SET maxmemory 2gb
valkey-cli -a your_password CONFIG REWRITE

Available eviction policies: allkeys-lru (default), volatile-lru, allkeys-lfu, noeviction. Use noeviction if you want Valkey to return errors instead of removing keys when memory is full.

Persistence

Valkey saves data to disk using RDB snapshots by default. Data survives server restarts. To check persistence status:

valkey-cli -a your_password INFO persistence

To enable AOF (Append Only File) for more durable persistence:

valkey-cli -a your_password CONFIG SET appendonly yes
valkey-cli -a your_password CONFIG REWRITE

AOF logs every write operation. Combined with RDB, this provides the most reliable data protection.

Change Password

To change the Valkey password:

valkey-cli -a current_password CONFIG SET requirepass new_password
valkey-cli -a new_password CONFIG REWRITE

Update /root/.valkey_credentials with the new password for reference.

Server Credentials

Valkey credentials are stored in /root/.valkey_credentials. This file contains the password from your order.

Updates

Valkey and the OS don't update automatically. To update manually:

apt update && apt upgrade -y

Troubleshooting

Problem Solution
Can't connect to Valkey remotely Check that port 6379 is not blocked by firewall. Verify bind 0.0.0.0 in /etc/valkey/valkey.conf
NOAUTH Authentication required You need to provide the password. Use valkey-cli -a your_password or AUTH your_password after connecting. Check /root/.valkey_credentials for the password
OOM command not allowed when used memory > maxmemory Memory limit reached. Increase maxmemory or change eviction policy. Check usage: valkey-cli -a pass INFO memory
Valkey won't start Check logs: journalctl -u valkey-server -n 50. Common cause: invalid config or disk full (df -h /)
Forgot Valkey password SSH in and check /root/.valkey_credentials
Blocked by Fail2Ban Use VNC console in your client panel to unban your IP
Can't connect via SSH Check that port 22 is not blocked. Try VNC console as a fallback


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 19