Issue connecting local appium server to Jenkins

I currently have a setup that is running appium test cases locally for a mobile application using android studio. I have tried to implement this into jenkins where i would use the jenkins slave to basically run the test for me locally. However it is not working and i get a Request Error timed out when trying to initiate the appium test in the jenkins log.
I figured maybe i need to set up a selenium server hub and node to work with Appium but that still does not connect my server to the jenkins slave.
For some background, i have the same set up for browsing testing where i have just specified my IP and its able to run the test cases on my local through jenkins slave using the selenium server.
Below is how i have set my capabilities, maybe im missing something code wise?

const capabilities = {
platformName: ‘Android’,
‘appium:automationName’: ‘UiAutomator2’,
‘appium:deviceName’: ‘Android’,
};

const wdOpts = {
hostname: ‘my IP’,
port: parseInt(process.env.APPIUM_PORT, 10) || 4723,
logLevel: ‘info’,
capabilities,
};

driver = await remote(wdOpts

When you start the Appium server, see if there is any external IP enabled to access the Appium server. If it shows only the local one, then it won’t work.

Hello, thanks for responding.
It shows three addresses and I’ve tried all three. Still doesn’t work.
I know selenium is different but I have a similar set up there where I just run selenium standalone and just use the address in my code to execute it from a different machine.
I know it should work because why would appium give that as an option.