๐ How to Set a Static IP on a VPS: Step-by-Step Guide
Using a static IP address on a VPS is essential for stable operation of web services, application servers, remote access, and more. Unlike dynamic IPs, a static address doesn't change after reboot and remains constant. This article explains how to assign a static IP address on popular operating systems.
๐ก Why Use a Static IP?
- ๐ถ Reliable connection without IP changes;
- ๐ Easier DNS and SSL certificate configuration;
- ๐ Ability to create consistent firewall, NAT, VPN rules;
- ๐ฏ Required for apps needing precise IP access;
- ๐ก Convenient for SSH, FTP, and RDP access.
๐ฅ Setting Static IP on Linux (Ubuntu/Debian)
Most modern systems use Netplan. Open the configuration file:
sudo nano /etc/netplan/01-netcfg.yaml
Example configuration:
network:
version: 2
ethernets:
eth0:
dhcp4: no
addresses:
- 192.0.2.10/24
gateway4: 192.0.2.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
Apply the changes:
sudo netplan apply
๐ช Setting Static IP on Windows Server
1. Go to Network Connections โ Adapter Settings.
2. Find IPv4 Protocol and open its properties.
3. Choose Use the following IP address and enter:
- The IP address assigned by your hosting provider;
- Subnet mask (typically 255.255.255.0);
- Gateway address;
- DNS servers:
8.8.8.8and1.1.1.1.
After saving the settings, restart the network adapter. Your server will now use the same IP address consistently.
๐ง Tips and Recommendations
- ๐ Make sure the IP belongs to your VPS and doesnโt conflict with others;
- ๐ถ Check server availability after applying the changes;
- ๐ Update your firewall rules if the IP was changed;
- ๐ Use a DNS name if IP change is possible in the future;
- ๐ If issues arise โ restart the network interface or the server itself.
If you're having trouble configuring your IP address or the server becomes unreachable โ contact Bit.Hosting support. We'll help you set everything up! โ๏ธ