How to install Karaf on Ubuntu

I have a new Ubuntu installation. A few months ago I did a test OpenHab install on Windows and I got used to using the Karaf terminal. And I also saw it on my test Raspberry Pi install. So now that I am setting up what I hope to be my last install, I have OpenHab running on a fresh Ubuntu install. But no Karaf. I did some googling, and I see a Karaf package related to Apache, but I am not planning on running a web server. I know OH comes with one, but it’s not using apache is it??? Anyway, that’s a long way of asking, how do I install Karaf for OpenHab on Ubuntu?

Hey,
You can safely ignore karaf package provided by Apache repositories, it does not apply here. Please use openhab package instead. You should be on safe side by following install instructions: https://docs.openhab.org/installation/linux.html

Kind regards,
Lukasz

Yes it is. Karaf is the base upon which OH is built. If you are running OH 2.x, you are running on top of Karaf. When you install OH, you get Karaf. You do not need to install anything separately.

OK… Let me ask a different way. On the other systems (pi & windows), when I would ssh in, there would be a Karaf info script. And I could also run certain commands in the shell. I don’t see that info data (server running, etc) and I don’t think I can run the smarthome commands. Is there something else that I need to do?

By the way, I did follow the instructions on that page, but the only mention of Karaf is in the last paragraph. Since I installed by package, I don’t have anything in my /opt directory.

Sorry for the super-noob questions!

You don’t need to worry about Karaf installation. As Rich already said, you will get it installed together with OpenHab.
I believe you might be running into difficulties because you SSH into your own system. By default most of Linux distributions have SSH enabled so when you do ssh user@localhost you log into your system shell via network socket. In order to log into OpenHab you need to specify a port option for SSH ssh -p 8101 user@localhost.
In practice it will be ssh -p 8101 openhab@localhost or ssh -p 8101 openhab@127.0.0.1.

If you still experience troubles getting there check what google says about your ssh command output and, if there will be no clear answer, bring it here so we can work it out.

There is also a script to run the local Karaf client.

In addition to what @splatch was saying, you can only SSH into Karaf from localhost by default, but that is simple to change. Otherwise, you need to SSH into the system (if you’re not sitting at the console) and then SSH into Karaf.