Install Visual Studio Code on your desktop computer (not on the openHAB host)

In the documentation about editors:

There is a line which warns about installing the VS Code editor on the same machine as OpenHAB.


Do the two interfere with each other in some way?

I think it is save to install/use VScode on your openHAB system.

But in general that is not what the average user want.
So the guide points out you might want to install it on your desktop rather than your server.

The OpenHAB server is on a separate LAN. I access it via Remote Desktop through a firewall. To follow the recommendation of separating the the server from the desktop, I would actually have to buy and add another computer to the separate LAN. If there is some technical reason for the separation, I’ll have to evaluate it before I spend the money.

Is there a technical reason to separate the two?

Most people run OH headless (i.e. no GUI) on SBCs (e.g. Raspberry Pis). VSCode requires a UI and even an RPi 4 could struggle to run VSCode and OH side by side since both are memory hogs (VSCode can be so in the extreme). But despite what one may think is common sense, we had many many users attempt to install VSCode on a RPi 3 that doesn’t have a graphical environment at all.

It’s also good practice to separate your development from production.

There might be some shared ports or something like that but if you have a powerful enough of a machine in terms of RAM and CPU to support both the two should live side by side gracefully. Most OH users do not, hence the warning.

Not really. If the machine running OH has SSH server enabled, install the Remote SSH extension into VSCode on your machine that is outside that LAN. It can SSH into your OH machine and make it appear for all intents and purposes that VSCode is running on that separate machine. It works quite nicely.

1 Like

Ok, that makes sense.

Usually yes, but most of what I will be automating gets its information from either Philips Hue, or arduino connected sensors. It is next to impossible to have these connected to two machines at the same time. So basically I would be writing code, then would not have a test environment to see if what I wrote actually does what I intended it to do.

I am retired now, but I have been writing code for over 35 years. I am just trying to get a good grasp of the OpenHAB language and the working environment before I start writing and committing code. So when I see something I don’t understand I tend to ask the “stupid” questions :slight_smile:

As already stated this aims to be more of a best practice, than a must have.
You have to keep in mind that the docs are written for all kinds of users with different knowledge levels.

So many users won’t have the network knowledge you seem to have.
At least that is my impression from what i read in your posts.

I think it is perfectly fine to vary from the best practice, when you definetely know what you are doing.
But for the docs we have to aim for the average user in the explanations, including some tips that probably won’t make sense for everyone. :slight_smile:

Not necessarily, you could run something like code-server. Hence you can stay with headless on the actual server.

Though agreed better keep it seperate.

Which puts us back in the “running two things that are memory hogs” territory.

I actually ran code-server for awhile in my system and used it for openHAB configuration. But I still used the ssh-fs extension (Remote SSH wouldn’t work at the time, now who knows) because of memory concerns.

1 Like