Skip to content

Dedicated Server: IP Configuration (Ubuntu/Debian)

Learn how to configure a static IP address on a Linux server running Ubuntu or Debian

12 November 20262 min read32 Views0 helpful

Introduction

Configuring IP addresses on your Linux Dedicated Server lets you control how your server communicates over the network. This includes assigning IP addresses, defining the default gateway, and setting up the DNS servers required for network connectivity.

Warning: Server unreachable due to a missing internet connection?

If your server is no longer reachable because of an incorrect network configuration or a missing internet connection, remote access via SSH may no longer work. Use the HTML5 console in Remote Management to connect to your server and correct the network configuration.

Preparation

Before configuring a static IP address, make sure you have the following information ready:

  • The IP address you want to assign
  • Subnet mask
  • Default gateway
  • DNS servers

You can find this information in the Network tab for your Dedicated Server in the ZapX panel.

Configuration

Ubuntu (Netplan)

Ubuntu installations use Netplan for network configuration. Connect to your Dedicated Server via SSH and find the Netplan configuration file in the /etc/netplan/ directory. Open the configuration file:

bash
nano /etc/netplan/50-cloud-init.yaml

Adjust the configuration to define a static IP address:

Code
network:
  version: 2
  ethernets:
    eth0:
      match:
        macaddress: "bc:24:11:5f:5c:34"
      addresses:
      - "109.230.238.45/24"
      nameservers:
        addresses:
        - 8.8.8.8
        - 1.1.1.1
      set-name: "eth0"
      routes:
      - to: "default"
        via: "109.230.238.1"

Adjust the following values to match your network configuration:

  • 109.230.238.45 → Your static IP address
  • 109.230.238.1 → Your gateway
  • DNS addresses → Your preferred DNS servers

Save the file and apply the configuration:

Code
sudo netplan apply

Debian

Debian often uses the network interfaces configuration file instead of Netplan. Connect to your Dedicated Server via SSH and open the network interfaces file:

Code
nano /etc/network/interfaces

Add or adjust the configuration for your network interface. Example configuration:

bash
auto lo
iface lo inet loopback

# Die primäre Netzwerkschnittstelle
allow-hotplug ens18
iface ens18 inet static
        address 134.255.219.160/24
        gateway 134.255.219.1
        # dns-* Optionen werden vom resolvconf-Paket umgesetzt, falls installiert
        dns-nameservers 1.1.1.1

Adjust the values to match your network configuration:

  • address → Your static IP address
  • netmask → Your subnet mask
  • gateway → Your default gateway
  • dns-nameservers → Your preferred DNS servers

After saving the configuration file, restart the network service:

Code
systemctl restart networking

Verification

After applying the configuration, check that the new IP address has been applied correctly. Run the following command in the terminal:

Code
ip a

This command displays all network interfaces on the system along with their current configuration details. Find the interface you configured in the output. Depending on your system, it is usually named eth0, ens18, or something similar.

In the interface section, you will find the inet entry, which shows the assigned IPv4 address. The output should include the static IP address you configured. For example:

Code
inet 109.230.238.45/24

If the correct address is displayed, the static IP configuration was applied successfully. If the new IP address does not appear, check the configuration file again and make sure the changes were saved correctly before applying the configuration again.

Conclusion

Congratulations! You have successfully configured your IP address on your Linux server. Our support team is available every day if you have any further questions or issues—don't hesitate to contact us! 🙂

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

Connect to your server via SSH and open the Netplan configuration file in /etc/netplan/ (for example, with nano /etc/netplan/50-cloud-init.yaml). Enter your IP address, nameservers, and default route according to your network details.
You need the IP address to assign, the subnet mask, the default gateway, and the DNS servers. You can find these in the Network tab for your Dedicated Server in the ZapX panel.
Use the HTML5 console in Remote Management to connect to your server independently of its network connection and correct the configuration.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.