DEV Community

Cover image for Setting up a new dev machine

Setting up a new dev machine

𝐁𝐚𝐛𝐢 ✨ on June 02, 2022

As developers we have had to set up our development environment from scratch at least once. Whether it's after getting a new machine or switching...
Collapse
 
deozza profile image
Edenn Touitou • Edited

I was so tired to set up dev environment because I was switching computers, changing os, ... that I now use remote workspace solutions.

Pick a server. Something light with 4g of ram and 64g of ssd should do the trick. Install on it docker and docker compose (to create tailored dev environment related to a dev project), portainer (to manage the containers), nginx-swag (to reverse proxy the containers to clean urls), micro (a cool text editor in the command line), fish (to have a better cli with autocompletion and stuff), and then your favorite editors. It could be code-studio, if you are a visual studio user. Or the whole jetbrains suite thanks to jetbrains projector (mind that 4g of ram might not be enough as jetbains IDE are resource black holes).

Now, you have the same dev environment accessible from anywhere, from any device. Laptop, desktop, smartphone, tablet, xbox one x, you name it. As long as it has a wifi connection and a browser.

If you don't want to open source it and handle all of that yourself, you could use external solutions like gitpod.

Collapse
 
babib profile image
𝐁𝐚𝐛𝐢 ✨

That's interesting! Never thought of that...remote workspace solutions

Collapse
 
deozza profile image
Edenn Touitou

It's developping quite quickly recently. Thanks to covid and remote working. You can even build a whole remote workspace (and not only for development) with solutions like kasm. But it's more tailored towards big companies. There you will have a full ubuntu experience directly from the browser

Thread Thread
 
babib profile image
𝐁𝐚𝐛𝐢 ✨

Awesome! Thanks for sharing. Would definitely give it a try

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Intriguing!

Collapse
 
babib profile image
𝐁𝐚𝐛𝐢 ✨

Ikr

Collapse
 
leob profile image
leob

Yeah your coding environment completely "in the cloud" and accessible from anywhere with a thin/dumb terminal (can be almost anything - desktop, laptop, tablet, phone - although the last one is probably not very practical) - that's the holy grail ... doesn't VSCode already have a complete "spaces" solution for this?

Collapse
 
deozza profile image
Edenn Touitou

I think you are refering to coder.com ?

Thread Thread
 
leob profile image
leob

Hadn't heard about code.com, no I meant Gitbhub Codespaces github.com/features/codespaces

Thread Thread
 
deozza profile image
Edenn Touitou

Oh yeah. I haven't tried it yet, as it was (is still ?) in beta

Thread Thread
 
leob profile image
leob • Edited

Well that probably means it's free lol, so that's good :) ... if it would be alpha then I'd think twice (typically you're then constantly busy working around problems and issues), but most of the time "beta" means it's almost perfect :)

Collapse
 
alesbe profile image
alesbe

Seems like a good solution! The experience is the same as using a local machine? You don't notice any delay or screen resolution issues?

Collapse
 
deozza profile image
Edenn Touitou

The experience is the same. From times to times, projector is a bit laggy because of how heavy it is compared to code-server. But otherwise, 99% of the time you won’t feel a difference

Collapse
 
jmccabe profile image
John McCabe

Making sure to take account of relatively recent changes to Docker's licensing model :-)

Collapse
 
sherrydays profile image
Sherry Day

your must-have tools

Things to clean your keyboard and screen!

Maybe it's not what folks were looking for, but if you're starting fresh, you have a chance to keep this one clean.

Collapse
 
babib profile image
𝐁𝐚𝐛𝐢 ✨

😂 not what I was expecting for sure

Collapse
 
shawncrigger profile image
Shawn Crigger

I use a keyboard lock program so I can lock the keys when I clean the keyboard can’t stand a dirty laptop.

Collapse
 
weasnerb profile image
Brian Weasner

My keyboard lock program is the power button

Collapse
 
gochev profile image
Nayden Gochev • Edited

I do wsl2 backup ... and then just restore ;)

VOALA :+)

More info :

I am using Windows yes but all development is inside wsl2.

so I just do :

C:> wsl.exe --export Ubuntu c:\data\ubuntu.tar

copy the ubuntu.tar to the other machined and just do

C:> wsl.exe --import UbuntuOrOtherName d:\wsl\UbuntuDataFolder c:\data\ubuntu.tar

thats all :)

Collapse
 
shawncrigger profile image
Shawn Crigger

That’s awesome i was unaware you could do that but this year has been the first Microsoft company I’ve worked for in 25yrs. I’m very impressed with Microsoft compared to say XP or Vista. They are really spending some money to become dev platform of choice

Collapse
 
wrench1815 profile image
Hardeep Kumar • Edited

The first tool or software that i setup is ofcourse operating system. There's no better tool than it. Setting it up as per my needs is what I first do. And it also helps knowing it better.

Must have tools

  • a terminal
  • vscode
  • nvim(linux)
  • insomnia
  • Vivaldi browser

Language specific tools

  • poetry(python)
  • yarn (node)
  • nvm(linux)

Linux specific

  • zsh
  • oh my zsh
  • powerlevel10k
Collapse
 
babib profile image
𝐁𝐚𝐛𝐢 ✨

This is neatly laid out.

I have to ask. You're not a fan of chrome browser or Firefox?
Also why'd you pick out Vivaldi? (first time hearing it 😂)

Collapse
 
wrench1815 profile image
Hardeep Kumar

Ehhh it's just i had to install too many extensions for debugging css then the customizations were not enough for me. Accidentally came across Vivaldi. It's got all the css debugging tools i need, got inbuilt screenshot, note taking, emails tracking, great deal of customizations and on top of that, it comes with a nice tab stacking feature which i really love a lot.

Collapse
 
shawncrigger profile image
Shawn Crigger

Since I’m working for a windows company now it took me awhile to find the tools that give me similar experiences as Mac. I would also add Powertools, Windows Terminal Preview Edition, WSL2, VSC with Tabnine extension and RemoteSSH

Collapse
 
devops_bro profile image
Devops Bro

I actually love the process of setting up a new dev computer. It’s the perfect time to dump old apps and try new apps.

Collapse
 
katafrakt profile image
Paweł Świątkowski

this

Collapse
 
andrewbaisden profile image
Andrew Baisden
Collapse
 
babib profile image
𝐁𝐚𝐛𝐢 ✨

Just went through it. It's a great write up thanks for sharing.

I couldn't help but notice you use a lot of browsers

Collapse
 
andrewbaisden profile image
Andrew Baisden

Yes I have a lot installed but really i'm only using Brave each day and for testing Firefox, Chrome and Safari usually.

Collapse
 
babib profile image
𝐁𝐚𝐛𝐢 ✨
  • The first software I always install is the chrome browser. 🤷🏽 It's usually my default 😊

And honestly speaking I sometimes have to make a list for the rest but still forgot some tools. My must-haves are usually

  • node, npm, VS code (with favorite plugins and extensions), git, intelliJ, jdk, xampp, postman

I'm sure I've forgotten some but they come as the need arises 😂

Collapse
 
briandoesdev profile image
Brian Heidrich

I actually use Vagrant to manage my dev environments. I have a repo for my different dev environments that has my Vagrantfile. So any time I reinstall Windows or reset my Macbook I only need to install Vagrant and VMWare Workstation Pro.

Collapse
 
babib profile image
𝐁𝐚𝐛𝐢 ✨

Thanks for sharing. First time hearing about Vagrant.

I have a lot to learn!

Collapse
 
anasrin profile image
anasrin

git

not only for repository project but also for repository software configuration / setting file such as dotfiles in *nix term.
this is make set up more easier, just store your configuration as a git repository and upload on git hosting like GitHub and just clone on your new system / machine.

stow

stow is symlink farm manager, managing dotfiles symlink folder.
simple yet powerful.

docker

for me docker is like lightweight and fast virtual machine or local VPS, with docker I can make Dockerfile (basically just bunch of command to install dependency and pack it into an image file) and I don't need to worry about missing any dependency.
just need to binding port and project folder and you ready to develop and testing.
pretty much my workflow is using docker.

tmux

tmux is a terminal multiplexer, tmux allow you to create split pane, window, and many more without depend on your terminal.
I also install tmux on docker image.

neovim

my text editor of choice, run on terminal, simple, lot of feature such as plugin and LSP.
I also install neovim and LSP (depending on project stack) on docker image and run from docker container.

lazygit

simple terminal UI for git commands.
work great in tmux by setting shortcut to popup lazygit and I install lazygit in docker too.

alacritty

just a simple terminal emulator, nothing more.
great to combine with tmux.

firefox

my browser of choice, not resource intensive and pretty good for reading (documentation for most of the time) and keep connect with people.
using firefox with difference profile just to make it easy to organize.

pretty much my workflow is on terminal.

Collapse
 
waylonwalker profile image
Waylon Walker

Fantastic list! stow is essential for setting up a new machine!

Collapse
 
k_penguin_sato profile image
K-Sato • Edited
  • The first tool/software you setup?
    Probably Homebrew!

  • your must-have tools
    Hard to say but VSCode or Chrome!

Collapse
 
babib profile image
𝐁𝐚𝐛𝐢 ✨

Just checked it out. It's dope! The Readme file is concise and comprehensive. Thanks for sharing!

Collapse
 
babib profile image
𝐁𝐚𝐛𝐢 ✨

Everybody seems to have custom scripts for setting up their workspace 😅

Collapse
 
hijoe profile image
HiJoe

This is the way.

Collapse
 
nikfp profile image
Nik F P

I'm not a full time dev, so my machines have to pull double duty for other work. Related to dev I do the following:

First tools to set up:

  • VS Code
  • Docker
  • WSL2 (I use Windows machines)

Then within WSL2:

  • Git
  • Node Version Manager
  • Oh-My-Posh
  • PNPM (the only globally installed Node package I use)

Pretty much everything else I could install for local development (postgres, redis, etc) I run with Docker containers instead, keeps my local installs list short and clean.

Not required but I freaking love it: Windows Terminal. It's configurable and it just works.

Collapse
 
anasrin profile image
anasrin

same thing, install everything on docker image

Collapse
 
waylonwalker profile image
Waylon Walker

I have an ansible playbook that installs everything I need for my development workflow. I have a single script that will setup ansible and run through the playbook. I keep it in my dotfiles.

curl https://raw.githubusercontent.com/WaylonWalker/devtainer/main/bootstrap | bash
Enter fullscreen mode Exit fullscreen mode
Collapse
 
marceloandrade profile image
Marcelo Andrade R.

In a brand new machine (almost always linux) first things to install are git and vim then I install my dotfiles github.com/marceloandrader/dotfiles then the password manager (pass), then start working and reviewing what do I need, things that I install during that time are docker, asdf (to install different versions of node, postgresql, mysql, php, elixir) then in each project just docker compose up -d to install dev dependencies.

Collapse
 
unsungnovelty profile image
Nikhil • Edited

I have been playing with Nix package manager which provides reproducibility. And Nix package manager can be installed on most Linux distros and MacOS. This means you don't necessarily need to use NixOS to take advantage of Nix package manager. Just install Ubuntu, Debian, Arch or in MacOS and install Nix package manager. Another thing is that once you have setup nix and have a nix configuration file, all you have to do is run a command to reproduce the same result in a system. No more starting from scratch.

Another cool thing I am yet to play with is that you can use multiple versions of a package and use each version independently with nix package manager. This means AFAIK, I can have two versions of nginx and use both versions independently at the same time.

Nix repo have most of the apps necessary for a developer. IMO lesser packages than Arch repos including AUR and larger than a lot of the Linux distros.I can get latest stable packages like other rolling distros with unstable channel of nix. This will be my future. I would recommend checking it out -> nixos.org/learn.html.

Collapse
 
ahmetcetin profile image
Ahmet Cetin

Or keep your repos in GitHub, open the repo in browser, and press dot in your keyboard (“.”). Voilà, you start edit your code in vscode using your settings and plugins even if you keep your settings in GitHub as well.

Collapse
 
basicpixel profile image
O. AlQudah

I start (on Linux) by updating system packages, then using the package manager to install my essential tools (useful cli tools, browser, notion, telegram, vscode etc.), then I clone my dotfiles repo to get app configs just like they were before moving.

Collapse
 
highasthedn profile image
highasthedn

On my long to-do-list is an item called "Setup dev environment with WSL". I tried it once but was struggling with a super slow React application which hot loading time was terrible. I think that's a problem with Windows / NTFS stuff, didn't had time and desire to have a closer lock to it. Maybe some day I will do it 😄
So for now first stuff I install for a new dev machine is Git for sure, followed by nvm, Docker and VSCode. I love the settings sync feature in VSCode which is fetching my settings and desired plugins from my GitHub account, so I don't need to start configuring everything from the scratch

Collapse
 
luiz0x29a profile image
Real AI • Edited

Linux Xen Server.
I only use VMs as my desktop, if the hardware crashes or I need to set up another, I just move 10TB of file while I sleep.

I never reinstall things, I only update them, but I keep snapshoots of the images.
Its years since I had a full blown reinstall.

Sometimes I install new tools, but I keep images isolated from each other usually by project.

Collapse
 
darthbob88 profile image
Raymond Price

The first thing I setup is OneDrive, because I have a folder with all the applications I need to get a computer back to full operation. Then I run a Ninite installer with most of the stuff I need, install VSCode and Settings Sync to download my extensions there.

I also install Git, NodeJS/.NET runtimes, and some other fun stuff because this is also my personal machine, but those are the notable ones.

Collapse
 
eddycorderol profile image
Eddy Cordero

I hear about a company that gives for new devs a batch script that called a Package Manage and install all tools that developer need for work.

You could implement that and when you need to move to other computer is only run the script.

Also some IDE or code editors allow you to save all config on your account and you only need to log in on your new computer.

Collapse
 
jzombie profile image
jzombie • Edited

I use several computers and all the major operating systems, so my setup can get crazy sometimes, however, I've found this to be rather useful...

VSCode has awesome support for remote development if you have multiple machines and want to use one (or more of them) as a potential dev server: code.visualstudio.com/docs/remote/ssh

Many of the extensions using these tools will run on the remote server, and you can use a low-end machine for VSCode, and it will run your linter and various extensions, on the remote machine.

It comes in really handy for development servers you may want to run in the cloud somewhere (i.e. on DigitialOcean / Vultr), and you can just code right on top of them.

It's also useful if you just want to use another local computer to hack around on some code stored on another computer on your LAN.

After the initial setup, the plugins you have configured to work on the remote dev server will be synced to the client servers on connect, for the duration of that session.

It feels like you're not even using a remote machine, plus it maps the remote ports you use to localhost.

Collapse
 
dgosza profile image
Diego Souza

I’m on ubuntu… I got a shell script to install all softwares that I need in my device. Some things i cant install, such as zsh theme and some configurations in terminal…
in the same shell script, there’s a little step by step, in comment section, who has the links and “how-do” to do X and Y stuff

Collapse
 
peterwitham profile image
Peter Witham

Over time I have started to think more about remote machines or containers to help with this. The problem with that for me is remote is great until you loose Internet (hey it happens more often than we think).

Right now I try to keep my automated script up to date for all the big things, but here's my starter.

  • I start with Xcode to get the command line tools.
  • Next is brew and run my script.
  • I recently started using this great script (paid version) Ruby on Mac Prime. It keeps Ruby and other vitals unto date without me chasing them all the time.
  • Then it's 1Password so I can access accounts easily.
  • JetBrains tool suite.

And that's my basic starter, doesn't sound like much but it gets all the things I need in place to start with the other things.

Collapse
 
raibtoffoletto profile image
Raí B. Toffoletto

I have a custom python script to install everything I like in a new linux vm, tools , my confifs and nodejs! Very handy, only thing I mess with my desktop OS are my ssh keys, everything else is done in vms 😁

Collapse
 
mkultra329 profile image
Matt Kokidko

This should be easy since I am doing it now. Also, I’m a Linux command line junkie that usually work on windows for work so that should explain the first few: Git bash with my custom .bashrc and .bash_alias for quicker commands and some functions to pretty print remote branch commit and log details. Download tmux, the libs to enable it in the git bash shell, and my tmux.conf. Keepass to pull in my 10+ year old password file. WSL with Debian. Gvim, EMacs, and Notepad++. Winmerge. Firefox and chrome, logging in and pulling all my synced bookmarks and extensions. Firefox containers, tweak them and add new container or set of containers for new work environment. Vscode. Possibly squirrel sql client. Move mouse from the windows store to keep the computer from going to sleep when I’m looking at my other computer or stepping away for a few minutes.

Collapse
 
faaktap profile image
Fakie Tap

I discovered choco late in my life... but i do love it!

Collapse
 
hnrq profile image
Henrique Ramos

The first thing I install is chezmoi and I apply my dotfiles using:

sh -c "$(curl -fsLS chezmoi.io/get)" -- init --apply $GITHUB_USERNAME
Enter fullscreen mode Exit fullscreen mode

and then I install VSCode.

Collapse
 
codewander profile image
codewander • Edited

Try as hard as you can to use gitpod, then fallback to dev, possibly using asdf, on machine if you hit a severe roadblock.

Collapse
 
hijoe profile image
HiJoe • Edited

I use dotfiles and run a script.

Collapse
 
pequenodharma1 profile image
Tiago Nunes

Definitly homebrew first

Collapse
 
ricardochan profile image
Ricardo Chan

Homebrew, and I have a script which I use to install my dotfiles :)

Collapse
 
programmingisajoke profile image
Programming is a Joke

I have actually written a post on this topic.
dev.to/programmingisajoke/how-i-se...

Collapse
 
cednore profile image
cednore

I am a big fan of ubuntu as well. Here's a gist I use whenever I have fresh install of OS.
gist.github.com/cednore/65a11bef1f...

Collapse
 
im6h profile image
Vu

Here, this is my post for setup environment for backend develop.

dev.to/im6h/my-setup-mac-for-backe...