Goal
Connect over SSH from any network and reach non-web services over IPv4.Prerequisites
- A running VPS and the private key that matches the public key you gave at order time.
Workflow
1
Open the server, then Networking. The SSH row shows the command with the server’s SSH port.
2
Run it, for example ssh -p 24817 root@myserver.compute.stackshift.cloud. From a network with IPv6 you can also run ssh root@<IPv6 address> on port 22.
3
To limit who can try to connect, choose Only allow some addresses and list IP addresses or ranges.
4
For another service, open Forwarded ports, pick TCP or UDP, enter the port on the server and choose Forward port.
The SSH port
- Each new VPS gets one SSH port on the shared IPv4, picked from 20000 to 39999 when the server is created. It forwards to port 22 on the server.
- The port works with SFTP, rsync, scp, Ansible, CI deploy steps and remote managers such as Coolify. Each of them accepts a custom port.
- Your client’s real IP address reaches the server, so fail2ban, sshd logs and AllowUsers rules see the real source.
- Anyone can try to connect until you set Only allow these addresses. Enter addresses or ranges such as 102.89.34.17, 197.210.8.0/24, up to 20. Leave it empty to allow everyone. The limit applies to the shared IPv4 port; on IPv6 use the server’s own firewall.
Forwarded ports
- Forward up to 10 ports per VPS, not counting SSH. StackShift picks the public port from 20000 to 39999, and the row shows <shared IPv4>:<public port> → port <n> · TCP or UDP.
- The visitor’s IP is kept. Each forward can have its own Only allow list.
- Use Edit to change a forward’s allowed addresses and Stop forwarding to remove it. The change applies within about 15 seconds.
- Port 22 is already forwarded as SSH. A forward to port 25 stays closed unless a mail request is approved.
- Every port is already open on IPv6, so IPv6 clients connect to the real port directly.
- One VPS cannot reach another VPS through the shared IPv4 and a forwarded port. Use IPv6 between servers.
When a forwarded port is not enough
Clients that can only use a well-known port on IPv4, such as 5432 for PostgreSQL or 51820 for WireGuard, need a dedicated IPv4. With one attached, every port on that address goes straight to the server.Expected result
SSH works over both IPv4 and IPv6, and each forwarded port answers on <shared IPv4>:<public port>.
Common failures
Related guides
How a VPS is reached
Every VPS gets its own public IPv6, a name under compute.stackshift.cloud, websites and SSH over a shared IPv4, and outbound IPv4. A dedicated IPv4 is an optional add-on.
Dedicated IPv4 add-on
Attach an IPv4 address that only your VPS uses, for a fixed IP partners can allow-list, well-known ports on IPv4, or a mail server.
Troubleshoot VPS networking
Match the symptom to the right check: SSH port, allowed addresses, DNS records, certificate status, the app port or the PROXY protocol.