Debian 10 Selenium oserror 11 connection

im facing a issue where selenium try to connect to a Website but fails. The vServer im running my script on has internetconnection and im not sure why this happen. i installed firefox using apt-get firefox-esr and the installation was completed. im using python 3.9 and the same code works on windows fine. Here is the code im using:

# coding=utf8

import os
import PyAuthGG
import time
import random
import colorama
import sys
import concurrent.futures
import re
import threading
import string
import captchatools
import json
import ctypes
import requests
import uuid
import hashlib
from discord.ext import commands
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from import WebDriverWait
from import expected_conditions as EC
from import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from colorama import Fore, Style
from sys import stdout

delay = random.randint(1, 2)
profile = webdriver.FirefoxProfile()
options = webdriver.FirefoxOptions()
options.binary_location = "geckodriver.exe" if == "nt" else "/usr/bin/firefox"
profile.set_preference("general.useragent.override", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0")
options.set_preference("dom.webnotifications.serviceworker.enabled", False)
options.set_preference("dom.webnotifications.enabled", False)
options.set_preference("dom.disable_beforeunload", True)
options.set_preference("dom.popup_maximum", 0)
driver = webdriver.Firefox(firefox_profile=profile, options=options, executable_path="geckodriver.exe" if == "nt" else "./geckodriver")

def Title(text):
    return os.system("title {}".format(text))

def Clear():
    return os.system('cls' if == 'nt' else 'clear')

def verification_logo():
    if == "nt": 
      ctypes.windll.kernel32.SetConsoleTitleW('[Verification] | Loading...')

The Traceback is following:

Traceback (most recent call last):
  File "", line 41, in <module>
    driver = webdriver.Firefox(firefox_profile=profile, options=options, executable_path="geckodriver.exe" if == "nt" else "./geckodriver")
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/firefox/", line 174, in __init__
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/", line 321, in execute
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Connection refused (os error 111)

Please dont tell me this is a duplicate when you dont understand the code. i already looked in Google, found only peoples with simmilar issues but no solution i found solved this current issue.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum