# Proxmox Installation

What you need to install on local machine?

1. Download Proxmox ISO from <https://www.proxmox.com/en/downloads/proxmox-virtual-environment>
2. Prepare a flash drive (8gb is enough for this)
3. [Rufus ](https://rufus.ie/en/) (use it to burn the ISO to your flash drive)
4. Follow the default instruction on the screen
5. Login to <https://your\\_local\\_ip:8006/> with your password submitted on installation GUI.

What you need to install on vds?

1. Install debian (bookworm or any recomended from proxmox ve website). then ssh to the machine.
2. Add the GPG key and adjust the APT sources:

```
curl -o /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg http://download.proxmox.com/debian/proxmox-release-bookworm.gpg
echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list
```

If you do not have a Proxmox VE Enterprise subscription and wish to avoid unauthorized access errors, you can comment out the Proxmox VE Enterprise repository with the following command:

```go
echo '# deb https://enterprise.proxmox.com/debian/pve bookworm InRelease' > /etc/apt/sources.list.d/pve-enterprise.list
```

Update the packages:

```go
apt update        # Update package lists
apt full-upgrade  # Update system
```

3. Install Proxmox VE

   ```go
   apt install proxmox-ve
   ```

   Restart the server

   After a restart, the Proxmox kernel should be loaded. Run the following command in order to see kernel release information:

   ```go
   uname -r
   ```

   The output should contain `pve`, for example: `6.5.13-1-pve`

   You can access the web interface by navigating to `https://<main address>:8006`.
4. Enable IP Forwarding on the Host

* For IPv4 and IPv6:

  ```bash
  sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
  sed -i 's/#net.ipv6.conf.all.forwarding=1/net.ipv6.conf.all.forwarding=1/' /etc/sysctl.conf
  ```
* Apply the changes:

  ```bash
  sysctl -p
  ```
* Check if the forwarding is active:

  ```bash
  sysctl net.ipv4.ip_forward
  sysctl net.ipv6.conf.all.forwarding
  ```

5. Setup Network Configuration on Host
   1. example of host network<br>

      <figure><img src="https://2425195691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbpAUu80KC7r7G8etEHT%2Fuploads%2FhRlFjwP2Tp2X5gJB9cqj%2Fimage.png?alt=media&#x26;token=2e6d2359-260e-4d60-8323-5f7572c2dca5" alt=""><figcaption></figcaption></figure>
   2. example of client network<br>

      <figure><img src="https://2425195691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbpAUu80KC7r7G8etEHT%2Fuploads%2FKOO1x8yZjm7b0vZDhO57%2Fimage.png?alt=media&#x26;token=37fd071d-2dbe-49b6-a15e-ede9657992fc" alt=""><figcaption></figcaption></figure>
6. Setup VM Templates
   1. go to CT Templates Menu\
      ![](https://2425195691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbpAUu80KC7r7G8etEHT%2Fuploads%2Fv1pm2dmwp6KB5nZZasU6%2Fimage.png?alt=media\&token=bbbccce0-6c13-4389-b853-d8b104ecf4ad)
   2. select template you want to download and add to your proxmox, you can choose any operating system ISO from here.<br>

      <figure><img src="https://2425195691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdbpAUu80KC7r7G8etEHT%2Fuploads%2FQS99P08aS7Mk29pwsU2U%2Fimage.png?alt=media&#x26;token=45b0457a-82b7-4bd8-8ef8-cbc35044666a" alt=""><figcaption></figcaption></figure>
7. If your VM/CT can't connect to internet, use post routing command, make sure to chane the IP to your own local ip settings before.

```
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -o vmbr0 -j MASQUERADE
```

8. &#x20;use `chmod firewall.sh` to make it executable
9. add your forward port and setting ip automatically by using cron

create new file firewall.sh

```
#!/bin/bash
/usr/sbin/iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -o vmbr0 -j MASQUERADE
/usr/sbin/iptables -t nat -A PREROUTING -p tcp -d 0.0.0.0/0 --dport 20002 -j DNAT --to-destination 192.168.110.150:20002
/usr/sbin/iptables -t nat -A PREROUTING -p tcp -d 0.0.0.0/0 --dport 20620 -j DNAT --to-destination 192.168.110.151:20620
/usr/sbin/iptables -t nat -A PREROUTING -p tcp -d 0.0.0.0/0 --dport 20619 -j DNAT --to-destination 192.168.110.151:20619
```

{% hint style="info" %}
you can port forward every port accessing your IP to your own local ip:port directly.
{% endhint %}

add the file to the cron, use command `crontab -e`  , if you're first time opening crontab, you'll be asked to choose which editor you want to use, default and easiest one is nano.

```
@reboot /bin/bash /root/firewall.sh >> /root/firewall.log 2>&1
```

adding command above are making the network forward rule to be reloaded everytime restart/reboot happens to the machine.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.codeblocklabs.com/other/proxmox/proxmox-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
