this post was submitted on 25 Feb 2024
154 points (91.4% liked)

Linux

48245 readers
509 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I installed a few different distros, landed on Cinnamon Mint. I'm not a tech dummy, but I feel I'm in over my head.

I installed Docker in the terminal (two things I'm not familiar with) but I can't find it anywhere. Googled some stuff, tried to run stuff, and... I dunno.

I'm TRYING to learn docker so I can set up audiobookshelf and Sonarr with Sabnzbd.

Once it's installed in the terminal, how the hell do I find docker so I can start playing with it?

Is there a Linux for people who are deeply entrenched in how Windows works? I'm not above googling command lines that I can copy and paste but I've spent HOURS trying to figure this out and have gotten no where...

Thanks! Sorry if this is the wrong place for this

EDIT : holy moly. I posted this and went to bed. Didn't quite realize the hornets nest I was going to kick. THANK YOU to everyone who has and is about to comment. It tells you how much traction I usually get because I usually answer every response on lemmy and the former. For this one I don't think I'll be able to do it.

I've got a few little ones so time to sit and work on this is tough (thus 5h last night after they were in bed) but I'm going to start picking at all your suggestions (and anyone else who contributes as well)

Thank you so much everyone! I think windows has taught me to be very visually reliant and yelling into the abyss that is the terminal is a whole different beast - but I'm willing to give it a go!

(page 3) 24 comments
sorted by: hot top controversial new old
[–] [email protected] 14 points 8 months ago (28 children)

Linux is a slightly different way of thinking. There are any number of ways that you can solve any problem you have. In Windows there are usually only one or two that work. This is largely a result of the hacker mentality from which linux and Unix came from. "If you don't like how it works, rewrite it your way" and "Read the F***ing Manual" were frequent refrains when I started playing with linux.

Mint is a fine distro which is based off of Ubuntu, if I remember correctly. Most documentation that applies to Ubuntu will also apply to you.

Not sure what exactly you installed, but I'm guessing that you did something along the lines of sudo apt-get install docker.

If you did that without doing anything ahead of time, what you probably got was a slightly out of date version of docker only from Mint's repositories. Follow the instructions here to uninstall whatever you installed and install docker from docker's own repositories.

The Docker Desktop that you may be used to from Windows is available for linux, however it is not part of the default install usually. You might look at this documentation.

I don't use it, as I prefer ctop combined with docker-compose.

Towards that end, here is my docker-compose.yaml for my instance of Audiobookshelf. I have it connected to my Tailscale tailnet, but if you comment out the tailscale service stuff and uncomment the port section in the audiobookshelf service, you can run it directly. Assuming your not making any changes,

Create a directory somewhere,

mkdir ~/docker

mkdir ~/docker/audiobookshelf

This creates a directory in your home directory called docker and then a directory within that one called audiobookshelf. Now we want to enter that directory.

cd ~/docker/audiobookshelf

Then create your docker compose file

touch docker-compose.yaml

You can edit this file with whatever text editor you like, but I prefer micro which you may not have installed.

micro docker-compose.yaml

and then paste the contents into the file and change whatever setting you need to for your system. At a minimum you will need to change the volumes section so that the podcast and audiobook paths point to the correct location on your system. it follows the format <system path>:<container path>.

Once you've made all the needed changes, save and exit the editor and start the the instance by typing

sudo docker compose up -d

Now, add the service directly to your tailnet by opening a shell in the tailscale container

sudo docker exec -it audiobookshelf-tailscale /bin/sh

and then typing

tailscale up

copy the link it gives you into your browser to authenticate the instance. Assuming that neither you or I made any typos you should now be able to access audiobookshelf from http://books If you chose to comment out all the tailscale stuff you would find it at http://localhost:13378

docker-compose.yaml

version: "3.7"
services:
  tailscale:
    container_name: audiobookshelf-tailscale
    hostname: books                         # This will become the tailscale device name
    image: ghcr.io/tailscale/tailscale:latest
    volumes:
      - "./tailscale_var_lib:/var/lib"        # State data will be stored in this directory
      - "/dev/net/tun:/dev/net/tun"           # Required for tailscale to work
    cap_add:                                    # Required for tailscale to work
      - net_admin
      - sys_module
    command: tailscaled
    restart: unless-stopped
  audiobookshelf:
    container_name: audiobookshelf
    image: ghcr.io/advplyr/audiobookshelf:latest
    restart: unless-stopped
#    ports:                                                                  # Not needed due to tailscale
#      - 13378:80                                                                                                     
    volumes:
      - '/mnt/nas/old_media_server/media/books/Audio Books:/audiobooks'       # This line has quotes because there is a space that needed to be escaped.
      - /mnt/nas/old_media_server/media/podcasts:/podcasts                               # See, no quotes needed here, better to have them though.
      - /opt/audiobookshelf/config:/config                                       # I store my docker services in the /opt directory. You may want to change this to './config' and './metadata' while your playing around
      - /opt/audiobookshelf/metadata:/metadata
    network_mode: service:tailscale                                  # This line tells the audiobookshelf container to send all traffic to tailscale container

I've left my docker-compose file as-is so you can see how it works in my setup.

load more comments (28 replies)
[–] [email protected] 3 points 8 months ago

Ok, so I don't know the specifics, this might not be entirely accurate, but this is a general step-by-step guide for Debian based distros like Mint.

Install docker

The first thing you need to do is install docker, this can be done via whatever GUI you use for a package manager or via the terminal using sudo apt install docker (I'm not sure docker is the name of the package, I'm just guessing, you can do an apt search docker to see what's available)

Add yourself to dockers

This is likely not needed on Mint, but just in case your user should be in the docker group, i.e. run sudo gpasswd -a docker. I'm almost sure Mint does this by default.

Enable docker systemd

This also might not be needed, again I'm almost sure Mint does this for you when you install docker, but just in case the command is sudo systemctl enable docker

Reboot

Because there have been changes to your user groups you need to relogin, easier to reboot.

use docker

Now you have a system with docker, you can test this by running the following command docker run hello-world, if you see a bunch of text that contains "Hello from docker" docker is working.

setup a docker-compose file

Create a folder, and in that folder create a text file called docker-compose.yaml in that file. This file will tell docker what you want to run, for example to have Nextcloud (which is an awesome self-hosted drive alternative. I'm not going to teach you the specific services you want, you can figure those out by looking at their page on the linuxserver page or something) you can look here https://hub.docker.com/r/linuxserver/nextcloud on how to write your docker-compose file, for example you could write:

services:
  nextcloud:
    image: lscr.io/linuxserver/nextcloud:latest
    container_name: nextcloud
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - ./config:/config
      - ./data:/data
    ports:
      - 8080:80
      - 443:443
    restart: unless-stopped

Then open a terminal on that folder and run docker compose up -d after that is done open a browser and go to http://localhost:8080 and begin using Nextcloud.

[–] [email protected] 3 points 8 months ago

Is there a Linux for people who are deeply entrenched in how Windows works

How Windows works is different I think?

I’m not above googling command lines that I can copy and paste but I’ve spent HOURS trying to figure this out and have gotten no where…

You don't need.

I heard you are using a debian-based distro, can you read the man pages for apt?

Then use apt to find docker, and get it.

Once it’s installed in the terminal, how the hell do I find docker so I can start playing with it?

It is not installed in the terminal. It is installed on the system, ON DISK!

docker should be installed on /usr/bin. It is on PATH. Type docker and see what happen. If not, try searching on /usr/bin (on BSDs third party software are separated from base, so docker should be installed on /usr/local/bin)

And the docker service should be started, if not. Use the fucking systemctl to start it. The service name should be docker, if I recall correctly

[–] [email protected] 4 points 8 months ago* (last edited 8 months ago)

Been there, now I have over 12 containers running h24 on an old spare laptop with everything exposed via traefik (reverse proxy), self-signed CA, local DNS...... what a ride ^^'.

The best advice and thats what helped me to get going, is to watch/follow some youtube videos about docker and how to expose your first container locally, so you get the general gist on how it works.

2 years ago, NetworkChuck introduced me to docker container. Not saying he's the best youtuber to get you into docker and learning and stuff, but it's a GOOD starting point :).

There is also Christian Lempa, Tech world with nana, who also will you give you some good pointer with docker and docker compose.

Good luck !

[–] [email protected] 17 points 8 months ago

There's not a fantastic GUI for managing docker. There are a few like dockge (my favorite) or Portainer.

I recommend spending some time learning docker run with exposed ports, bind volumes (map local folders from your drive to folders inside the container so you can access your files, configs, content, etc. Also so you don't lose it when you delete the container and pull a newer version).

Once you've done that, check out the spec page for docker-compose.yaml. This is what you'll eventually want to use to run your apps. It's a single file that describes all the configuration and details required for multiple docker containers to run in the same environment. ie: postgres version 4.2 with a volume and 1 exposed port, nginx latest version with 2 volumes, 4 mapped ports, a hostname, restart unless-stopped, and running as user 1000:1000, etc.

I've been using docker for home a LIGHT business applications for 8 years now and docker-compose.yaml is really all you need until you start wanting high availability and cloud orchestration.

Some quick tips though.

  • Search some-FOSS-app-name docker-compose read through a dozen or so templates. Check the spec page to see what most of the terms mean. It's the best way to learn how to structure your own compose files later.
  • Use other people's compose.yaml files as templates to start from. Expect to change a few things for your own setup.
  • NEVER use restart: always. Never. Change it to restart: unless-stopped. Nothing is more annoying than stopping an app and having it keep doom spiraling. Especially at boot.
  • Take a minute to set the docker daemon or service to run at boot. It takes 1 google and 30 seconds, but it'll save you when you drunkenly decide to update your host OS right before bed.
  • Use mapped folders for everything. If you map /srv/dumb-app/data:/data then anything that container saves to the /data folder is accessible to you on your host machine (with whatever user:group is running inside the container, so check that). If you use the docker volumes like EVERYONE seems to like doing, it's a pain to ever get that data back out if you want to use it outside of docker.
[–] [email protected] -2 points 8 months ago (2 children)

Man, good luck. Is there no other way you can accomplish that without Docker. I've been using Linux for years and I still don't know how to set up a docker container lol

[–] [email protected] 1 points 8 months ago
  1. Docker is not needed, I've had lots of self hosted things for years before using docker.
  2. Docker is not that hard, you just need to learn it like anything else, once upon a time going to a webpage was an unknown thing to all of us, yet now it's a daily thing.
[–] [email protected] 2 points 8 months ago* (last edited 8 months ago) (1 children)

Docker is not needed for this, it just helps keep things clean.

Edit - can the next person who downvotes this please explain why I'm wrong? I have run all these services without docker with no issue.

load more comments (1 replies)
[–] [email protected] 0 points 8 months ago
[–] [email protected] 1 points 8 months ago

Docker can be really confusing, but IMO being able to add and remove software without having changes made throughout your system is well worth the effort.

[–] [email protected] 5 points 8 months ago

I have been in and out of Linux for years and Docker is just... Hard. There's a thing called portainer, and it makes it so you can muck with Docker from a web browser, and that is literally all I know at this point. Still, might be helpful? I have some Docker stuff, and it works the way I assume my mom thinks Linux works. Someone typed fast and magic happened. Best of luck!

[–] [email protected] 5 points 8 months ago

Honestly, for those tools, I'd recommend posting in [email protected].

Echoing some other comments, those are decently complex tools all around. I'd recommend doing a few tutorials on docker before trying out that project (short ones, just to build a mental model).

As others have said, docker is a command line tool. docker -v in your terminal should be enough to "find" it. That'll show you the version of docker you have installed.

From there, I'd recommend the hello world image to start (this should get you there https://www.geeksforgeeks.org/docker-hello-world/).

From there, keep messing with it. Get more familiar with docker through their docs. Read a bit on images vs containers, port mapping, and volumes and mounts.

As others have said, look for docker only in the terminal. And then expect to spend a little time familiarizing yourself with what problem docker solves and how it solves it. Once you've got docker in your back pocket, you'll be very well situated to set up all kinds of apps.

And when you run into other problems, there's communities to answer and work through the issues

[–] [email protected] 36 points 8 months ago

Once it’s installed in the terminal, how the hell do I find docker so I can start playing with it?

It's not installed "in the terminal." It's installed on the computer; the terminal is just one way you might interact with it.

In particular, docker is a type of program called a 'daemon' or 'server': it runs in the background and doesn't have an interface, per se. You can run docker commands and get their output, and you can of course interact with the services you're using docker to run, but there is no "docker app" that runs as a foreground interactive process (either GUI app or ncurses terminal app).

[–] [email protected] 10 points 8 months ago

TBH I've been using Linux for over a decade, can install & set up Arch from scratch etc. and I still don't understand Docker.

[–] [email protected] 29 points 8 months ago

Keep in mind that you're not just learning to use linux, but also learning to use docker,and docker is a complex tool by itself, which makes your journey significantly harder.

I never user Sabnzbd so I wouldn't be of much help. However, you could post some of the problems you find, so that other people lay help you.

[–] [email protected] 3 points 8 months ago* (last edited 8 months ago) (2 children)

Docker is a ~~developer~~* tool, not really something you should be using without some technical knowledge, or at least some experience in the terminal. It's purely a terminal application, so you just type "docker" in the terminal to use it. You can also type "man docker" to view the manual (which shows arguments and command you can use) but again, that won't help much without some prior knowledge.

The things you're trying to use look like self-hosted web servers, which is a lot to set up for someone who's new to the terminal. I won't stop you if you want, but be warned. I'd recommend using something simpler like cozy, which you should be able to find and download in the software store.

*Edit: it's not only a developer tool, it's used for deployment as well. I lumped the two together. It's still a tool made for people with more familiarity using the terminal though.

[–] [email protected] 1 points 8 months ago* (last edited 8 months ago)

Docker is a deployment tool. Not a developer tool.

Unless you’re trying to simplify your deployment stack there isn’t really a compelling reason to install it unless you’re trying to learn something new for the fun of it.

With that said you need things to deploy to make it useful. Like a database server, web server, etc.

[–] [email protected] 5 points 8 months ago (1 children)

Docker is a developer tool

First, it's not. Second - so what if it is? Sounds like gatekeeping to me. They've expressed interest in learning how to use it, that's enough.

[–] [email protected] 8 points 8 months ago (1 children)

If they want to use it that's fine. I'm just cautioning against using a command line tool like that until they feel somewhat comfortable with the terminal.

load more comments (1 replies)
[–] [email protected] 1 points 8 months ago

There are distributions like CasaOS and TrueNAS Scale that try to offer at least a bit of graphical guidance for some popular apps.

Otherwise, you're jumping into the server pool, Windows doesn't really work that different from Linux in that area (in the sense that you can just click on things).

[–] [email protected] 55 points 8 months ago (4 children)

The crazy pills are the first step in learning. Embrace the crazy. Take more pills.

[–] [email protected] 5 points 8 months ago

It worked for me!

load more comments (3 replies)
[–] [email protected] 68 points 8 months ago (6 children)

Docker is a cli only app, if you want a gui interface check out docker desktop

https://docs.docker.com/desktop/install/linux-install/

load more comments (6 replies)
load more comments
view more: ‹ prev next ›