# Update ESXi host via CLI

  1. Enable Maintenance mode and SSH on the host

  2. Login via SSH

  3. Open local firewall ports to access the internet

esxicli
esxcli network firewall ruleset set -e true -r httpClient
  1. Search for the latest patch
esxicli
esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
  1. Patch the host
esxicli
esxcli software profile update -p <the patch you want to install from step 4> -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
  1. Reboot the host after the patch is installed

  2. Close the local firewall ports

esxicli
esxcli network firewall ruleset set -e false -r httpClient
  1. Disable SSH and Maintenance mode