Your web hosting partners since 2004.
Buy now »

FAQ » Servers

How to Install OpenVZ 7 on CentOS 7

This is a complete guide to converting a CentOS 7 server to a OpenVZ host server.

The recommended pattern to install OpenVZ is to use the ISO and install it on the bare metal.

However, that isn't always possible, so in this tutorial, we'll explain how to install OpenVZ on CentOS.

You'll need a server with CentOS 7 x86_64 installed.

I'll be using CentOS 7.9.


Ensure you have everything up to date.

yum update && yum upgrade

Get OpenVZ releases

yum localinstall
yum localinstall
yum install epel-release -y


yum install python3
rpm -Uvh
rpm -Uvh
rpm -Uvh


mv /etc/yum.repos.d/CentOS-* /root/
pm -e --nodeps --justdb json-c
yum erase jansson
yum localinstall
yum localinstall
yum install prlctl prl-disp-service vzkernel *ploop*
yum update -y

Check grub

awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
grub2-set-default 1
grub2-mkconfig -o /boot/grub2/grub.cfg
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg



Initial Settings

modprobe ploop
modprobe pfmt_ploop1
modprobe pfmt_raw
modprobe pio_direct

Update sysctl

cat >> /etc/sysctl.conf <<EOF
# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
net.ipv4.ip_forward = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv4.conf.default.proxy_arp = 0

#Enables source route verification
net.ipv4.conf.all.rp_filter = 1

#Enables the magic-sysrq key
kernel.sysrq = 1

#We do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

#only use these if you build a NAT VPS
#otherwise, do not copy these lines
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.default.forwarding= 1

sysctl -p

Set SELINUX permissive

# sed -e s/SELINUX=disabled/SELINUX=permissive/ /etc/selinux/config

Install quota tools

yum -y install vzctl vzquota ploop

Install all available Linux Distro templates

yum install *ez.noarch



Last updated: 2022-02-20

« Go Back

Order now »

The support has been fantastic with help in areas they are not obliged to offer but still do.