Your commands are fine and as has been pointed out this will save all the empty space on your drive too. However if you choose the secure wipe option when you installed the system the drive's empty space will be full of random noise so compressing the output buys you very little.
You should use a larger block size for the copy and avoid polluting the systems buffer cache to make the raw reads faster.
- The dd options iflag=direct or oflag=direct read or directly from the device bypassing Linux's caching layer.
- The dd option bs (block size) tells dd how much data to read or write at once, modern disk drives work much faster with larger chunks of data.
Compression is CPU intensive and gzip only uses a single core, meaning this will likely be the limiting factor speedwise for the copy. Using pigz which uses all CPU cores will make it faster but still likely to be CPU bound.
As a rough ball park with a modern CPU I would use compression if storage space was an issue or if you are connected by something slower than USB2. USB3, SATA or 100Mbit+ networking will almost certainly be faster than gzip so will gain no speed but might save some space.
The commands I would use in the case of slow connection to storage (ie 10Mbit ethernet or USB1/2) or lack of space are:
dd if=/dev/sda bs=1M iflag=direct | pigz -c > /media/external/image.sda.gz
If you have a fast connection to storage and the space used is not an issue I would use the following command:
dd if=/dev/sda of=/media/external/image.sda.raw oflag=direct iflag=direct bs=1M