Unable to add host on VM running server

Getting this error

ERROR: CATTLE_URL cannot contain localhost or 127.0.0.1, please check the Host Registration URL.

Have been searching for about 4 hours now trying every fix i can find and nothing seems to work.

at first i had accessed the web interface with localhost:8080 then i swapped to my servers IP address but its still giving error above, i have entered server IP as host ip left it blank and used 1 2 and 3 ip addresses above the server ip same issue every time. Kind of at my wits end, thought i would reach out here before i find another solution, just trying to run an OWNCLOUD server in a container

This error is coming from the docker run rancher/agent command from the UI when adding a Custom host. This is generated from the Host Registration URL setting (Admin -> Settings). When you corrected the Host Registration URL and copied the new command to add the host, this should be fine.

Thank you! that fixed that issue now i am running into this issue
http://192.168.8.20:8080/v1 is not accessible (Failed to connect to 192.168.8.20 port 8080: No route to host)

all the topics i see have a https and i do not have that issue

sudo docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.6 http://192.168.8.20:8080/v1/scripts/5830099427D32020690E:1483142400000:Qi7CAuVpugC6pZuee6E2g40Q

I apologize in advance for all the questions. I was tasked to set this up for my college class and am not at all familiar with containers and have spend literally hours trying to figure this out, all for just an OWNCLOUD server running in a container.

ip route get 192.168.8.20 inside the agent container and on the host could help you figure that out I think.